elasticsearch - _all field in match phrase prefix query -
my documents have field product_code
containing string value pc00xxa
x
replaced digit 1..9. i'm expecting result of 9 documents phrase prefix query:
{ "query": { "match": { "_all": { "query": "pc001", "type": "phrase_prefix" } } } }
... result empty. using product_code
instead of _all
, expected 9 documents.
using prefix query instead of phrase prefix query seems work expected both _all
, product_code
fields. following query gives me 9 documents:
{ "query": { "prefix": { "_all": { "value": "pc001" } } } }
elasticsearch documentation says "the match_phrase_prefix same match_phrase, except allows prefix matches on last term in text". in case have 1 term in query expect work prefix.
how phrase prefix query differ prefix query when query contains single term? , why use of _all
gives me fewer results specifying field name explicitly?
Comments
Post a Comment