match-phrase

executing a multi-“match-phrase” query in Elastic Search

左心房为你撑大大i 提交于 2020-01-02 00:28:03
问题 this should be obvious to me but is not. The following two match only the second phrase (in this case, "Cape Basin") "query": { "match_phrase": { "contents": { "query": "St Peter Fm", "query": "Cape Basin" } } } "query": { "match_phrase": { "contents": { "query": ["St Peter Fm", "Cape Basin"] } } } while the following croaks with an error "query": { "match_phrase": { "contents": { "query": "St Peter Fm" }, "contents": { "query": "Cape Basin" } } } I want to match all documents that contain

executing a multi-“match-phrase” query in Elastic Search

徘徊边缘 提交于 2020-01-02 00:27:07
问题 this should be obvious to me but is not. The following two match only the second phrase (in this case, "Cape Basin") "query": { "match_phrase": { "contents": { "query": "St Peter Fm", "query": "Cape Basin" } } } "query": { "match_phrase": { "contents": { "query": ["St Peter Fm", "Cape Basin"] } } } while the following croaks with an error "query": { "match_phrase": { "contents": { "query": "St Peter Fm" }, "contents": { "query": "Cape Basin" } } } I want to match all documents that contain

Elastic search query using match_phrase_prefix and fuzziness at the same time?

為{幸葍}努か 提交于 2019-12-23 11:59:12
问题 I am new to elastic search, so I am struggling a bit to find the optimal query for our data. Imagine I want to match the following word "Handelsstandens Boldklub". Currently, I'm using the following query: { query: { bool: { should: [ { match: { name: { query: query, slop: 5, type: "phrase_prefix" } } }, { match: { name: { query: query, fuzziness: "AUTO", operator: "and" } } } ] } } } It currently list the word if I am searching for "Hand", but if I search for "Handle" the word will no longer

Maintain sequence order for match phrase query with slop in Elasticsearch Java API

血红的双手。 提交于 2019-12-11 10:41:50
问题 I am trying to do a query which should be similar to the phrase query except that there can be gaps within consecutive tokens. Example: Document: "a b c d" Search: "a c" >> This should return the document, Search: "c a" >> This should not return the document. Phrase query ensures that the order will remain only when no slop value is being used. Once I add some slop value (2, 3 etc), it starts to break order, and with sufficiently large slop value, it will probably just be as normal match

executing a multi-“match-phrase” query in Elastic Search

馋奶兔 提交于 2019-12-04 22:52:17
this should be obvious to me but is not. The following two match only the second phrase (in this case, "Cape Basin") "query": { "match_phrase": { "contents": { "query": "St Peter Fm", "query": "Cape Basin" } } } "query": { "match_phrase": { "contents": { "query": ["St Peter Fm", "Cape Basin"] } } } while the following croaks with an error "query": { "match_phrase": { "contents": { "query": "St Peter Fm" }, "contents": { "query": "Cape Basin" } } } I want to match all documents that contain both either phrases exactly as entered. Update: See update immediately above Your first query is not