If you want this to be a mininum you could - Use your cross fields query as a filter <http://www.elastic.co/guide/en/elasticsearch/reference/1.5/query-dsl-filters.html>. Specifically, a query filter: http://www.elastic.co/guide/en/elasticsearch/reference/1.5/query-dsl-query-filter.html - Use a most or best fields as your main search query
This would eliminate any search results without a match somewhere, cutting off the long tail as you need to, but score using most fields. Does that make sense? On Tue, Apr 14, 2015 at 12:24 AM, Andre Dantas Rocha < [email protected]> wrote: > Hi Doug, > > Thank you for your quick response and comprehensive explanation. It does > make sense. > > We are using cross_fields (with the "and" operator) because we want to > make sure that the documents returned contain *all* the search terms > somewhere. > > For example, the search for "100 john smith" would return only one > document. ("john smith" matches the name and "100" matches the address") > > We expect no results for "200 john smith" as 200 appears nowhere. > > But if we search for "john smith" we should get both documents back and > the document with "john smith" should be the first one is the list > (since terms "john" "smith" matches on the same field). > > Is there possible to accomplish this with best_fields or most_fields? > > Thanks again, > > Andre > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elasticsearch/b9f21865-c060-434e-b456-80a230ac6439%40googlegroups.com > <https://groups.google.com/d/msgid/elasticsearch/b9f21865-c060-434e-b456-80a230ac6439%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- *Doug Turnbull **| *Search Relevance Consultant | OpenSource Connections, LLC | 240.476.9983 | http://www.opensourceconnections.com Author: Taming Search <http://manning.com/turnbull> from Manning Publications This e-mail and all contents, including attachments, is considered to be Company Confidential unless explicitly stated otherwise, regardless of whether attachments are marked as such. -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CALG6HL-otHfwDshPnv5e8Ys4gm8wnOdZzkSzzW8Fs9YEYodrUg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
