Is it possible to consider hyphen (separate by spaces) in query_string as a
hyphen, rather than lucene "minus" (like explained in lucene http://lucene.apache.org/java/3_4_0/queryparsersyntax.html#-)? E.g.
consider it as "minus", when it's followed by the word, not space.
Is it possible to consider hyphen (separate by spaces) in query_string as a
hyphen, rather than lucene "minus" (like explained in lucenehttp://lucene.apache.org/java/3_4_0/queryparsersyntax.html#-)?E.g.
consider it as "minus", when it's followed by the word, not space.
Reproduce:
Consider following mapping -query_all with hyphens · GitHub contenthttps://gist.github.com/1404391#file_content.json. Address contains
hyphen, but it's cut down by standard tokenizer.
Now try to query, using the same analyzer -query_all with hyphens · GitHub no luck. IMHO it's
because this hyphen is treated as lucene "minus". Escaping text with quotes
gives proper results -query_all with hyphens · GitHub.
Yes, I need query_string, because it's used as search input in client. Term
and exact match is preferred, but client doesn't support it now and I was
looking for solution on server side, specifically in ES.
But anyway I force client devs to use term instead :).
Is it possible to consider hyphen (separate by spaces) in query_string
as a
hyphen, rather than lucene "minus" (like explained in lucenehttp:// Apache Lucene - Query Parser Syntax)?E.g.
consider it as "minus", when it's followed by the word, not space.
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.