Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
4.7, 6.0
-
None
Description
Following the discussion on SOLR-5528. It would be nice to support suggest queries to be processed by more than one suggesters configured in one suggest component.
The new response format is as follows:
{ responseHeader: { status: 0, QTime: 3 }, suggest: { suggester1: { e: { numFound: 1, suggestions: [ { term: "electronics and computer1", weight: 100, payload: "" } ] } }, suggester2: { e: { numFound: 1, suggestions: [ { term: "electronics and computer1", weight: 10, payload: "" } ] } } } }
where 'suggest1' and 'suggest2' are the names of the configured suggester and 'e' is the query.
Example query:
localhost:8983/solr/suggest?suggest=true&suggest.dictionary=suggest1&suggest.dictionary=suggest2&suggest.q=e
Example configuration:
<searchComponent name="suggest" class="solr.SuggestComponent"> <lst name="suggester"> <str name="name">suggester1</str> <str name="lookupImpl">FuzzyLookupFactory</str> <str name="dictionaryImpl">DocumentDictionaryFactory</str> <str name="field">cat</str> <str name="weightField">price</str> <str name="suggestAnalyzerFieldType">string</str> </lst> <lst name="suggester"> <str name="name">suggester2</str> <str name="lookupImpl">FuzzyLookupFactory</str> <str name="dictionaryImpl">DocumentDictionaryFactory</str> <str name="field">name</str> <str name="weightField">price</str> <str name="suggestAnalyzerFieldType">string</str> </lst> </searchComponent>