My quey is something like this : "query": { "span_near": {"clauses": [ {"span_multi":{"match":{"wildcard":{"name":{"wildcard":"comp*"}}}}} ,{"span_multi":{"match":{"wildcard":{"name":{"wildcard":"engaged"}}}}} ] ,"slop":0 ,"in_order":true,"collect_payloads":false } }
here I am searching for "comp* engaged" as a phrase wildcard in name field. If I have multiple fields how do I do it? If I have to boost some field is there a way? On Tuesday, September 9, 2014 11:02:27 AM UTC-7, Amish Asthana wrote: > > We have a requirement to phrase wildcard search in elastic search. > The requirement is to search for lets say search for "Barce* Me*i" and it > should give any document which has "Barcelona Messi" in a phrase in ANY > field. > We have been able to do it using span near with slop 0, and it works fine . > The issue is that it works only on a particular field of the document. > The question is how can we make it work for any field in the document? > > We tried to create a SPAN near query for each field and then encompass the > whole in a boolean query but it does not work. > > -- 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/b9a4acd5-a484-4e47-b036-576c36f789d7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.