I use the _lw_data_source_s field which holds the name of Fusion datasources.Ĭreate the datasources “art” and “tv”. The contextField parameter designates the field on which you’ll be filtering. We will be suggesting on the title field. As mentioned previously, you have the choice of using the AnalyzingInfixLookupFactory or BlendedInfixLookupFactory as your dictionary implementation. $FUSION_API_BASE (ex: $SOLR_API_BASE (ex: $FUSION_API_CREDENTIALS (ex: admin:password123)Įdit solrconfig.xml to enable suggestions. $FUSION_HOME (ex: $HOME/Lucid/fusion/fusion2.4.3/) Make sure to set the following environment variables or else defaults will be used: I created a script which automates the process I’m about to describe – you can run the script by cloning the following repo: STEP ONE After indexing documents to both datasources, I would like to enable suggestions on one of the datasources, but not the other. In the following example, I create a Fusion collection called suggestTest and assign it two datasources “art” and “tv”.In Fusion, datasources are distinguished by a _lw_data_source_s field. All other implementations will return unfiltered matches as if filtering was not requested. If you look to the Solr documentation you’ll see a note about how Context filtering ( suggest.cfq) is currently only supported by AnalyzingInfixLookupFactory and BlendedInfixLookupFactory, and only when backed by a Document*Dictionary. So issuing a query such as /suggest?q=do&fq=_lw_data_source_s:datasource_A is essentially equivalent to /suggest?q=do, ignoring the filter query completely. The widely-used fq parameter, however, does not filter results rendered by the suggest component. The goal is to enable suggestions on your search application, but to only return suggestions on documents from datasource_A, excluding any and all documents from datasource_B.Įnter “suggest.cfq”, the parameter which to some degree emulates the well-known Solr fq param. For this example, let’s choose two of the datasources, “datasource_A” and “datasource_B”. Suppose you have a collection which is comprised of various datasources. This blog post aims to showcase the versatility of the Solr Suggester and the process of achieving context-filtered suggestions in Solr. This article provides a thorough introduction to the Solr Suggester and discusses its history, design, implementation and even provides some comprehensive examples of its usage. The available literature on the Solr Suggester primarily centers on surface-level configuration and common use-cases. "Q: What did the Filter Query say to the Solr Suggester? Introduction
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |