Reputation: 13299
I need to do string search in Elasticsearch like:
This is the content stored in elasticsearch
and I want it to match with "content stored in
" for example, but not with "in stored content
". Currently with the simple search both match.
Also I want to match with partial strings like "ontent stor
" (not full words).
I know there are things like wildcard search, but they will scan all documents. I'd like to use features to have it run faster.
Upvotes: 0
Views: 85
Reputation: 2000
Wildcard search are heavy. You can use ngram token filter in your analyzer and do term search. It will take care of matching partial string. Make sure that you use a different analyzer for search(without ngram token filter) if you are not using term search.
Upvotes: 2