0
votes

I was trying to build spell checker on the top of solr. The basic information looks good enough http://wiki.apache.org/solr/SpellCheckComponent#Introduction

Can I somehow limit the scope of spell checker to a specific query. For e.g I want the spell checker to just correct spelling where genre=international. (genre is a text field defined in my schema.xml)

EDIT

To make the question more precise: How can I filter query for spell checker component. fq=genre:music&query=jacksn

Then the spell corrector should look only into the document which have genre:music

1
Just found your question, I asked about the same a couple of minutes ago. Did you find a solution for this?23tux

1 Answers

-1
votes

Do you want to restrict the dictionary building to a single field? If so you can modify your solrconfig.xml and set the dictionary source to the "genre" field:

<searchComponent name="spellcheck" class="solr.SpellCheckComponent">

  <lst name="spellchecker">
    <str name="name">default</str>
    <str name="classname">solr.IndexBasedSpellChecker</str>
    <str name="field">genre</str>

EDIT: So you have multiple countries and you have different products on each country. It might be more practical to split each country into its own core using a technique called sharding and this way you can configure your modules in each core.

Have a read: http://wiki.apache.org/solr/CoreAdmin