-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Hi, I have been looking into using the collate option of a phrase suggestion to filter out suggestions that would not produce search query results. There is some documentation here: https://www.elastic.co/guide/en/elasticsearch/client/net-api/2.x/suggest-usage.html
I see that the query currently needs to be inline:
.Collate(c => c
.Query(q => q
.Inline("{ \"match\": { \"{{field_name}}\": \"{{suggestion}}\" }}")
.Params(p => p.Add("field_name", "title"))
)
.Prune()
)
However, this means that I lose any Intellisense, and if I change my mappings in my index, no errors will be thrown until query time.
I can see that there is another another option instead of the inline search descriptor. It appears I can use a previously indexed query by using the .Indexed()
option:
.Collate(c => c
.Query(q => q
.Indexed(/* what goes here? */)
)
.Prune()
)
Though there doesn't seem to be any documentation on this and no tests either. Can someone point me in the right direction?
Thanks in advance.