Multiple context fields in suggester component

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple context fields in suggester component

Renuka Srishti
Hello All,

Is there any way to set multiple context fields in suggester component? Or
is there any way to apply multiple filters with suggester component in solr?

Thanks
Renuka Srishti
Reply | Threaded
Open this post in threaded view
|

Re: Multiple context fields in suggester component

Alessandro Benedetti
Simple answer is No.
Only one context field is supported out of the box.
The query you provide as context filtering query ( suggest.cfq=<query> ) is
going to be parsed and a boolean query for the context field is created [1].

You will need some customizations if you are targeting that behavior.

[1] query = new
StandardQueryParser(contextFilterQueryAnalyzer).parse(contextFilter,
CONTEXTS_FIELD_NAME);




-----
---------------
Alessandro Benedetti
Search Consultant, R&D Software Engineer, Director
Sease Ltd. - www.sease.io
--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
---------------
Alessandro Benedetti
Search Consultant, R&D Software Engineer, Director
Sease Ltd. - www.sease.io
Reply | Threaded
Open this post in threaded view
|

Re: Multiple context fields in suggester component

Renuka Srishti
Thanks Alessandro Benedetti for the response. Can you please share the
resources, so that I can explore more about customization of context filter.

On Tue, Feb 13, 2018 at 5:01 PM, Alessandro Benedetti <[hidden email]>
wrote:

> Simple answer is No.
> Only one context field is supported out of the box.
> The query you provide as context filtering query ( suggest.cfq=<query> ) is
> going to be parsed and a boolean query for the context field is created
> [1].
>
> You will need some customizations if you are targeting that behavior.
>
> [1] query = new
> StandardQueryParser(contextFilterQueryAnalyzer).parse(contextFilter,
> CONTEXTS_FIELD_NAME);
>
>
>
>
> -----
> ---------------
> Alessandro Benedetti
> Search Consultant, R&D Software Engineer, Director
> Sease Ltd. - www.sease.io
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
>
Reply | Threaded
Open this post in threaded view
|

Re: Multiple context fields in suggester component

Alessandro Benedetti
You can start from here :

org/apache/solr/spelling/suggest/SolrSuggester.java:265

Cheers



-----
---------------
Alessandro Benedetti
Search Consultant, R&D Software Engineer, Director
Sease Ltd. - www.sease.io
--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
---------------
Alessandro Benedetti
Search Consultant, R&D Software Engineer, Director
Sease Ltd. - www.sease.io