Hi
We have an index that uses an Autocomplete Suggester. The index definition is:
.Completion(c => c.Analyzer("standard")
.PreserveSeparators(true)
.MaxInputLength(100)
.Contexts(ctx=> ctx
.Category(x=>x.Name("country").Path(p=>p.Country))
.Category(x => x.Name("flags").Path(p => p.AvailableCategories))
)
.Name("localitySuggestions")
)
As you can see we have 2 category contexts.
When querying for example:
var searchResponse = await client.SearchAsync(s => s
.Size(MAX_SUGGESTIONS)
.Source(sf => sf.Excludes(e => e.Field("geometry")))
//.Query(q => q
//.Bool(bq => bq.Filter(filters)))
.Suggest(ss => ss
.Completion("suggestions", c => c
.Field("localitySuggestions")
.Prefix(prefix)
.Contexts(ctxs=>ctxs.Context("flags", ctx => ctx.Context(flags)).Context("country", ctx => ctx.Context(country)))
)
).Index("localities")
);
Elasticsearch uses an OR operation. i.e. it will return results if either is true.
Is there any way to make the operation an AND i.e.BOTH contexts must be true in order for the document to be matched?
Many thanks