nrtsearch icon indicating copy to clipboard operation
nrtsearch copied to clipboard

Support multiple contexts in one query

Open felfilali opened this issue 5 years ago • 1 comments

We should be able to filter by more than one context. For example:

context could be a list or a map <string, List> : client could add 2 geocontext: geocontext1: {precision:5, boost: 3} geocontext2: {precision:4, boost: 2}

Another context, using yelp use case as an example, would be the category of the a biz:

catcontext1: { names [restaurant, cafes], boost: 3}

more on this in previous review request. https://github.com/Yelp/platypus/pull/19/files/24ed6bb3dca8e4501811d96a1962b79bf74c3b8a#diff-4e19185040990a7739472e27f3ef1846

felfilali avatar Dec 14 '19 01:12 felfilali

Current code should already handles multiple contexts. So using above example we should be able to set contexts like so in our client

suggestLookupBuilder.addContexts("restaurant");
suggestLookupBuilder.addContexts("cafes");

Underneath it would just build a field with multiple terms and filter on them (using a SHOULD clause or MUST clause if we specify allTermsRequired in the input).

I am not sure if we might need to customize AnalyzingInfixSuggester if we need to support boost, precision, etc though

umeshdangat avatar Dec 14 '19 02:12 umeshdangat