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:

   1. Obama BEFORE Iraq - the first word(not term) is before the second in 
   a field text
   2. "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.
>
> [1] 
> http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/proximity-matching.html
>
> Regards,
> Lukas
>
> On Mon, Jan 19, 2015 at 10:02 AM, Petr Janský <petr....@6hats.cz 
> <javascript:>> wrote:
>
>> Noone? :-(
>>
>> Petr
>>
>> Dne úterý 13. ledna 2015 15:37:18 UTC+1 Petr Janský napsal(a):
>>>
>>> Hi there,
>>>
>>> I'm looking for a way how to access span_near and span_first 
>>> functionality to users via search box in gui that uses query string query.
>>>
>>>    1. Is there any easy way how to do it?
>>>    2. Will ElasticSeach folks implement operators like NEARx, BEFOR, 
>>>    AFTER, FIRSTx, LASTx to be able search by (using query string):
>>>       - specific max word distance between key words
>>>       - order of key words
>>>       - word position of key word in field from start and end of field 
>>>       text
>>>    3. Span queries enable to use only terms, is there a way how to use 
>>>    words that will be analysed by lang. analyser - stemming etc.?
>>>
>>>
>>> Thanks
>>> Petr
>>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "elasticsearch" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to elasticsearc...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/elasticsearch/f90a0eba-1b61-4a23-a2af-ec6a0c5e461f%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/elasticsearch/f90a0eba-1b61-4a23-a2af-ec6a0c5e461f%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/8e88fb60-0e1c-423e-8208-a5e01206c620%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to