Hyphens in query_string

Hello,

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.

Reproduce:
Consider following mapping -
https://gist.github.com/1404391#file_mapping.json and content
https://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 -
https://gist.github.com/1404391#file_query.json with no luck. IMHO it's
because this hyphen is treated as lucene "minus". Escaping text with quotes
gives proper results -
https://gist.github.com/1404391#file_query_with_quotes.json .

Regards,
Alexandr Vasilenko

I think the lucene query string parser works as this, why not
implement it yourself on the client side?

Do you need the query_string query at all - why not use the term query
(and index:no) if you always query the full string (or describe what
you need)?

Regards,
Peter.

On 29 Nov., 12:00, Alex Vasilenko aa.vasile...@gmail.com wrote:

Hello,

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.

Regards,
Alexandr Vasilenko

Hello Peter,

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 :).

Thanks,
Alexandr Vasilenko

2011/11/30 Karussell tableyourtime@googlemail.com

I think the lucene query string parser works as this, why not
implement it yourself on the client side?

Do you need the query_string query at all - why not use the term query
(and index:no) if you always query the full string (or describe what
you need)?

Regards,
Peter.

On 29 Nov., 12:00, Alex Vasilenko aa.vasile...@gmail.com wrote:

Hello,

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.

Reproduce:
Consider following mapping -
query_all with hyphens · GitHub contenthttps://
query_all with hyphens · GitHub. 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.

Regards,
Alexandr Vasilenko