I'm looking for a query so that "foo baz" matches the following documents:
"foobar baz"
"foo baz"
"baz foo"
"foo bazilion"
Basically I'd like to break down the search string into words and look for a
(prefix)match of all words in the index.
currently I'm using this query
'multi_match': {
'query': query_string,
'fields': ['_all'],
'type': 'phrase_prefix',
}
but it only works for a single word. For example a query for "baz foo" (word
order inverted) does not return a result.
(I'm also open for pretty expensive queries if that's necessary - there are
only few searches so functionality wins over raw performance.)
On Mon, May 26, 2014 at 1:21 PM, Felix Schwarz <felix.schwarz@oss.schwarz.eu
wrote:
I'm looking for a query so that "foo baz" matches the following documents:
"foobar baz"
"foo baz"
"baz foo"
"foo bazilion"
Basically I'd like to break down the search string into words and look for
a
(prefix)match of all words in the index.
currently I'm using this query
'multi_match': {
'query': query_string,
'fields': ['_all'],
'type': 'phrase_prefix',
}
but it only works for a single word. For example a query for "baz foo"
(word
order inverted) does not return a result.
(I'm also open for pretty expensive queries if that's necessary - there are
only few searches so functionality wins over raw performance.)
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.