[Searzh][W.I.P] A small scripting language made for searching!

Discussion in 'Programming' started by Citymonstret, Jun 19, 2015.

  1. I'm making a scripting language called "Searzh", it's mostly made for IntellectualSites - as we need a good system for our search page.

    Example of syntax, would be:
    Code (Text):

    #in:sql_table('cows')->search:sql_field(ALL)->fetch(SQL_ALL_FIELDS)->bind(ALL, SQL_FIELDS)->filter('age' < 30)->sort(SQL_INDEX)->format(JSON_PRETTY_PRINT)->output(CONSOLE).
    (It's subject to chane, and I'm not completely sure on how it will be)

    Code (Text):
    #in:channel('potatoes')->search:keyword('potato')->sortBy('post_date' if exists | null)->list(new table('potatoes'))<potatoes([sql]:'select * from test.potatoes'->as(new channel 'potatoes')->whereas('potatoes'.'potato' is keyword 'potato').
    Code (Text):
    #in:sql_table('cows')->search:sql_field('name')->fetch(SQL_ALL_FIELDS)->filter(strlen('name')<10)->filter('age' < 32)->sortBy('cow_number')->list(console(SQL_DATA_FORMAT)).

    Would anyone be interested in using this, and do you have ideas? Feel free to share :D
  2. Multi line queries/whatever would probably be considerably better. That way It'd be a huge deal easier to actually read them.
  3. And not as fun :D I want to make it easy for a computer to understand the queries, and not humans. Who has time to read search queries all day long anyways?

    Besides, I'm adding a frontend onto this. The one which we will use on IS, will look something along the lines of
    Code (Text):

    #in:sites #by:Citymonstret potatoes
    which would translate down to
    #in:sites->search('potatoes')->filter('author' = 'Citymonstret').
  4. You pose the question "Would anyone be interested in using this?". Unless it is easy to use and works in a sensible manner, probably not no.
  5. I don't really mind, just putting it out there.