Hi all,
I'm trying to get Suggesters up and running.
Using Phrase, Term, or Completion I always get the following error variation.
unable to parse SuggestionBuilder with name [COMPLETION]: parser not found"
unable to parse SuggestionBuilder with name [TERM]: parser not found"
unable to parse SuggestionBuilder with name [PHRASE]: parser not found"
additional error info:
Request failed to execute. Call: Status code 400 from: POST /index-play/searchresult/_search?pretty=true&typed_keys=true. ServerError: Type: named_object_not_found_exception Reason: "[4:21] unable to parse SuggestionBuilder with name [COMPLETION]: parser not found"
I'm having a hard time deciphering the error.
It seems as though the NEST libraries are missing the Suggester parsers?
I have tried multiple 6.x NEST versions and they all have the same issue.
Upgrading to 7.0alpha1 does change the error, but seems to cause a myriad of other issues, and I rather not use an alpha library in production.
I'm currently following this tutorial and working it into my existing code: https://github.com/elastic/elasticsearch-net-example/tree/6.x-codecomplete-netcore#part-6-suggestions
Currently using NES 6.1
Model:
public class SearchResult {
public SearchResult()
{
TitleSuggest = new CompletionField {Input = new List<string>(Title.Split(' '))};
}
public CompletionField TitleSuggest { get; set; }
//etc
}
Index Method:
public async Task<IActionResult> CreateIndex()
{
await _searchClient.CreateIndexAsync(SearchIndexName, indexSelector =>
indexSelector
.Mappings(mappingsDescriptor =>
mappingsDescriptor.Map<Models.SearchResult>(y => y.AutoMap().Properties(pr=>pr.Completion(c => c.Name(p => p.TitleSuggest)
))))
Suggest Method:
public async Task<ISearchResponse<SearchResult>> Suggest(string keyword)
{
return await _searchClient.SearchAsync<SearchResult>(
s =>
s.Suggest(ss => ss
.Completion("title", cs => cs
.Field(f => f.TitleSuggest)
.Prefix(keyword)
.Fuzzy(f => f
.Fuzziness(Fuzziness.Auto)
)
.Size(5))
}
Any insight would be great, thanks!