ElasticSearch Nest AutoComplete based on words split by whitespace -


i have autocomplete working elasticsearch (nest) , it's fine when user types in letters begining of phrase able use specialized type of auto complete if it's possible caters words in sentence.

to clarify further, requirement able "auto complete" such:

imagine full indexed string "this title". when user types in "th", comes suggestion current code.

i same thing returned if user types in "som" or "title" or letters form word (word being classified string between 2 spaces or start/end of string).

the code have is:

var result = _client.search<contentindexable>(             body => body                         .index(indexname)                         .suggestcompletion("content-suggest" + guid.newguid(),                                            descriptor =>                                            descriptor                                                .onfield(t => t.title.suffix("completion"))                                                .text(searchterm)                                                .size(size))); 

and see if possible write matches requirement using suggestcompletion (and not doing match query).

many thanks,

update: question has answer here leave here since title/description little easier search search engines.

the correct solution problem can found here: elasticsearch nest client creating multi-field fields completion

@kha think it's better use ngram tokenizer

so should use tokenizer when create mapping. if want more info, , maybe example write back.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -