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?
We're doing some sample queries and found that a query with "!" causes the
search to fail.
A couple questions:
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
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.