Behaviour of match_phrase_prefix in ES ES 8.9.0 is different from that in 7.17.7

ES 8.9.0

With a query having match_phrase_prefix of just one term, the search returns expected match; with the same query, percolate by id does not return expected match. The same (both search and percolate) work as expected in ES 7.17.7.

Repro steps:

  1. Create a new index with a str field of type text and a query field of type percolator
  2. Index a doc having {"str":"the quick brown fox jumps over the lazy dog"}
  3. Perform a _search {"query":{"match_phrase_prefix":{"str":{"query":"fox"}}}} to ensure the doc is searchable (wait until, when not) note _id
  4. Index a query {"query":{"match_phrase_prefix":{"str":{"query":"fox"}}}}
  5. Percolate by {"query":{"percolate":{"field":"query","index":"<myindex>","id":"<_id>"}}}

Note:

  • When ES 7.17.7 is used, all steps return expected results.
  • When ES 8.9.0 is used, all steps except the final step return expected results.
  • When ES 8.9.0 is used, without the match_phrase_prefix query or with the query with two-or-more tokens in #4, all steps return expected results.

And, btw, does match_phrase_prefix support single token in the query? Or does it expect two-or-more? There is no mentioning of this nor any change in behaviour in the hrefs below..

Help is appreciated.. Thanks..

appreciate any insights on this.. thanks..