solrconfig.xml
file to get suggestions based on matching against a title
field, as well as looking up terms in your main content
field.
http://localhost:8983/solr/sample/suggest?q=al
(replace ‘al’ with the string the end-user has typed) will bring back suggestions for both suggesters in this format:
backwardsCompatible
attribute) is enabled.
SolrQuerySuggestionService
to access suggestions. In resources/conf/services/suggestions
, create a configuration file (for example, querySuggestions.conf
) to contain the configuration parameters for the suggestion service. Here is an example of how this might look:
name
and source
attribute are required. The name
indicates which suggestion service is used. The source
gives the id for accessing the platform configuration attributes.
The remaining attributes shown here are optional. If parenthesis
is set to true, the query value, equated with the URL parameter suggest.q
, will be surrounded by parenthesis. The title
attribute gives a title to the list of suggestions. Custom parameters can also be set on the query. For example, count[5]
translates to count=5
on the query URL.
SolrSuggestionsParserService
to access suggestions. In resources/conf/services/suggestions
create a configuration file (for example, querySuggestions.conf
) to contain the configuration parameters for the suggestion service. Here is an example of how this might look:
name
and source
attributes are required. The source
attribute here refers to a Fusion platform configuration, which must have the backwardsCompatible
attribute set to true. The other required attribute for this service is suggester
. This is the name of the Solr suggester as defined in the solrconfig.xml. For example, using the example above, suggester
could be set to titleMatchSuggester or freeTextContentSuggester.
The remaining attributes shown here are optional and are the same as described above for when backwards compatibility is disabled.
SolrQueryTermsService
. In resources/conf/services/suggestions
create a configuration file (for example, queryTerms.conf
) to contain the configuration parameters for the terms suggestion service. Here is an example of how this might look:
name
and source
attributes are required as well as the term-fields
attribute. The name
indicates which suggestion service is used. The source
gives the configuration name for accessing the Solr platform’s configuration attributes (in the example shown above the platform configuration would be stored in resources/conf/platforms/solr/suggestions/terms.conf
. Within this platform configuration the requestHandler
attribute mat be defined. However, by default, this is set to /terms
.
The term-fields
attribute is equivalent to the terms.fl
parameter required by the Solr Terms Component. It is a comma-separated list of fields from which to retrieve terms. In the example above, only one field, Symbol
, is used.
The title
attribute gives a title to the group of suggestions that are returned by Solr. This title can be used to group suggestions in the UI.
<search:box>
: