Skip to content

Error searching for  #41

Closed
Closed

Description

@dmitrypol

FT.CREATE User SCHEMA name TEXT
FT.ADD User 'bob'
FT.SEARCH User ''

RESULT
(error) Syntax error at offset 0 near ''

Sometimes UI searches pass empty strings when person clicks Search w/o specifying anthing

Activity

  1. dvirsky commented on Apr 24, 2017

    @dvirsky
    Contributor

    It's still an error... you should catch that exception in your client, or not pass it to the server at all

  2. dvirsky commented on Apr 24, 2017

    @dvirsky
    Contributor

    I mean, I might change it, but it's a matter of taste basically.

  3. dmitrypol commented on Apr 24, 2017

    @dmitrypol
    Author
  4. dvirsky commented on Apr 25, 2017

    @dvirsky
    Contributor

    I know, but I hate to put something like:

    if (strlen(query) == 0) {
    // ignore the syntax error in the parser
    }

    so now what if the query is " "? or "   "? or ",. ?---- !!!? " or "a" (which is a stopword) - all of those are empty queries, I don't want to pre-process the query. I want the parser to just get it and do its best to parse it.

  5. dvirsky commented on Apr 25, 2017

    @dvirsky
    Contributor

    let's try this - I've added a rule in the grammar for empty queries. pull master and try it.

  6. added a commit that references this issue on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions