Query_string field specific search with nGram tokenizer


(Asif) #1

Hi all,
I want to search different fields for different substrings.

 e.g:

  say my documents have field_1, field_2 and field_3. I want to search 

documents where field_1 has "aa" field_2 has "bb" and field_3 has "cc".

   I know if I use nGram analyzer it is possible to search for "aa", 

"bb" and "cc" (using query_string) and put them into a must clause would
have worked; but, it does not take into account which match occurred in
which field.

   I read somewhere that query_string: { "query":{ 

"field_name":"string_to_match", field_name2:"string_to_match2"}} does that;
but, I don't see it working since I started using nGram analyzer.

Any help in this regard would be appreciated.

thanks
Asif

--


(system) #2