Characters that cause query to Fail

We're doing some sample queries and found that a query with "!" causes the
search to fail.

A couple questions:

  • Is this expected?
  • If so, are there other characters we should remove before querying?

Did you try escaping it ? I also have the same issue with ":" and "/". But
I am not sure the issue is with indexing or searching ?

Try escaping the character and run the query("!"), see if that helps.

-pk

Ah....gotcha. Cool. That fixed it!

On Thursday, July 26, 2012 3:50:59 PM UTC-4, Praveen Kariyanahalli wrote:

Did you try escaping it ? I also have the same issue with ":" and "/". But

I am not sure the issue is with indexing or searching ?

Try escaping the character and run the query("!"), see if that helps.

-pk

Hi Brandon,

  • If so, are there other characters we should remove before querying?

There are a number of special characters to watch out for. See the list at
the bottom of Apache Lucene - Query Parser Syntax

Brandon,

if you don't need query parser support ie. you don't expose operators like
AND, OR, NOT or phrases "foo bar" you can simply use a text query which
only goes through and analyzer without going through a QueryParser so you
don't need to worry about characters and escaping. this has also benefits
in security since nobody can issue very slow searches like fuzzy query like
foo~2 or wildcards like a*

here is a
link: Elasticsearch Platform — Find real-time answers at scale | Elastic

simon

On Friday, July 27, 2012 9:11:10 AM UTC+2, Chris Male wrote:

Hi Brandon,

  • If so, are there other characters we should remove before querying?

There are a number of special characters to watch out for. See the list
at the bottom of
Apache Lucene - Query Parser Syntax