ad 1) I am not sure I understand what you mean. If you want to use span
type of query then simply use it instead of query string query. Especially,
if you pass user input into the query then it is recommended NOT to use
query string query and you should consider using different query type (like
span query in your case).
ad 2) Not sure I fully understand but I can see match for some of those
requested features in span queries. Like "slop". I would recommend you to
read through chapters of "Proximity Matching" [1] to see how you can use
"slop".
ad 3) The input that goes into span queries can go through text analysis
process (as long as I am not mistaken). The fact that there are term
queries behind the scene does not mean you can not process your analysis
first.
May be if you can share some of your configs/documents/queries we can help
you more.
thank you for your answer. I checked the "Proximity Match" - "match_phrase"
and it's what I looking for. I'm only not able to find a way how to create
queries like:
Obama BEFORE Iraq - the first word(not term) is before the second in
a field text
"President Obama" AFTER Iraq - the phrase "President Obama" is after
Iraq in a field text
In other words, the match_phrase doesn't have in_order parameter like
span_near and for span_near I have to use terms - have to run analyzer for
words befor.
Do you have any idea how to implement these queries?
Thanks
Petr
Dne pondělí 19. ledna 2015 10:23:21 UTC+1 Lukáš Vlček napsal(a):
Hi Petr,
let me try to address some of your questions:
ad 1) I am not sure I understand what you mean. If you want to use span
type of query then simply use it instead of query string query. Especially,
if you pass user input into the query then it is recommended NOT to use
query string query and you should consider using different query type (like
span query in your case).
ad 2) Not sure I fully understand but I can see match for some of those
requested features in span queries. Like "slop". I would recommend you to
read through chapters of "Proximity Matching" [1] to see how you can use
"slop".
ad 3) The input that goes into span queries can go through text analysis
process (as long as I am not mistaken). The fact that there are term
queries behind the scene does not mean you can not process your analysis
first.
May be if you can share some of your configs/documents/queries we can help
you more.
Dne středa 18. února 2015 12:35:15 UTC+1 Petr Janský napsal(a):
Hi Lukas,
thank you for your answer. I checked the "Proximity Match" -
"match_phrase" and it's what I looking for. I'm only not able to find a way
how to create queries like:
Obama BEFORE Iraq - the first word(not term) is before the second
in a field text
"President Obama" AFTER Iraq - the phrase "President Obama" is
after Iraq in a field text
In other words, the match_phrase doesn't have in_order parameter like
span_near and for span_near I have to use terms - have to run analyzer for
words befor.
Do you have any idea how to implement these queries?
Thanks
Petr
Dne pondělí 19. ledna 2015 10:23:21 UTC+1 Lukáš Vlček napsal(a):
Hi Petr,
let me try to address some of your questions:
ad 1) I am not sure I understand what you mean. If you want to use span
type of query then simply use it instead of query string query. Especially,
if you pass user input into the query then it is recommended NOT to use
query string query and you should consider using different query type (like
span query in your case).
ad 2) Not sure I fully understand but I can see match for some of those
requested features in span queries. Like "slop". I would recommend you to
read through chapters of "Proximity Matching" [1] to see how you can use
"slop".
ad 3) The input that goes into span queries can go through text analysis
process (as long as I am not mistaken). The fact that there are term
queries behind the scene does not mean you can not process your analysis
first.
May be if you can share some of your configs/documents/queries we can
help you more.
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.