Hi all, I've been having difficulty creating a JSON query to find
fields that have multiple colons ':' in the query string. Multiple
colons results in a query parse failure, the console log shows
Caused by: org.apache.lucene.queryParser.ParseException: Cannot parse
'ends:with:colon': Encountered " ":" ": "" at line 1, column 9.
Although I can run wildcard queries or fuzzy queries, I'd like to be
able to do an exact match on the query string. Does anyone know how
to escape the characters in a query, or else have suggestions about
how to work around this?
Hi all, I've been having difficulty creating a JSON query to find
fields that have multiple colons ':' in the query string. Multiple
colons results in a query parse failure, the console log shows
Caused by: org.apache.lucene.queryParser.ParseException: Cannot parse
'ends:with:colon': Encountered " ":" ": "" at line 1, column 9.
Although I can run wildcard queries or fuzzy queries, I'd like to be
able to do an exact match on the query string. Does anyone know how
to escape the characters in a query, or else have suggestions about
how to work around this?
Yes, the lucene query string syntax, while useful for power users,
really needs to be parsed and corrected before being sent to ES.
You have three options here:
I have written a Perl module Elasticsearch::QueryParser
which will correct errors in query strings, and allow you
to filter out particular elements (eg field: prefix) from
your query string
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.