0
votes

I'm using Elasticsearch to build an autocomplete feature for a search app and I'm using the shingles tokenizer to create multi-word suggestions and an edge_ngram token filter on those tokens.

I have 55 JSON documents that I'm indexing, each document has 2 or more fields and 1 of those fields has multiple words separated by spaces.

If I use the ES match_phrase_prefix query with the _all field enabled, I should be able to get returned matches with just 1 or 2 character inputs? I want to use this query because Elastic itself says its a good query to use for "search as you type" behavior.

IS my thinking correct? Just need to make sure I'm on the right track before I put more time into this.

1

1 Answers

0
votes

Yes, with the shingles analyzer, you should be able to get results from 1 or 2 characters.

Remember to set the custom analyzer on your _all field.