You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Sa...@VerizonWireless.com on 2010/06/10 21:10:44 UTC

Spellcheck and Solrconfig

Hi,
We use Solr along with Drupal for our content management needs. The
solrconfig.xml that we have from Drupal mentions that "we do not
spellcheck by default" and here is our request handler from
solrconfig.xml. 

First question - why is it recommended that we do not spellcheck by
default
Secondly  - if we add spellcheck in <last-components> tag - will
spellcheck be enabled?

We are using basic Solr and Drupal configurations - only now - we are
looking at tweaking solrconfig and schema files. Any help is greatly
appreciated. 

Thanks,
Sai

  <requestHandler name="partitioned" class="solr.SearchHandler"
default="true">
    <lst name="defaults">
     <str name="defType">dismax</str>
     <str name="echoParams">explicit</str>
     <float name="tie">0.01</float>
     <str name="qf">
        body^1.0 title^10.0 name^3.0 taxonomy_names^2.0 tags_h1^5.0
tags_h2_h3^3.0 tags_h4_h5_h6^2.0 tags_inline^1.0
     </str>
     <str name="pf">
        body^2.0
     </str>
     <int name="ps">15</int>
     <str name="mm">
        2&lt;-35%
     </str>
     <str name="q.alt">*:*</str>

   <!-- example highlighter config, enable per-query with hl=true -->
     <str name="hl">true</str>
     <str name="hl.fl">body</str>
     <int name="hl.snippets">3</int>
     <str name="hl.mergeContiguous">true</str>
   <!-- instructs Solr to return the field itself if no query terms are
        found -->
     <str name="f.body.hl.alternateField">body</str>
     <str name="f.body.hl.maxAlternateFieldLength">256</str>
     <!-- JS: I wasn't getting good results here... I'm turning off for
now
     because I was getting periods (.) by themselves at the begining of
     snippets and don't feel like deubgging anymore.  Without the regex
is
     faster too -->
     <!--<str name="f.body.hl.fragmenter">regex</str>--> <!-- defined
below -->

    <!-- By default, don't spell check -->
      <str name="spellcheck">false</str>
    <!-- Defaults for the spell checker when used -->
      <str name="spellcheck.onlyMorePopular">false</str>
      <str name="spellcheck.extendedResults">false</str>
      <!--  The number of suggestions to return -->
      <str name="spellcheck.count">1</str>
    </lst>
    <arr name="last-components">
      <str>spellcheck</str>
      <str>elevator</str>
    </arr>
  </requestHandler>

Re: Spellcheck and Solrconfig

Posted by Chris Hostetter <ho...@fucit.org>.
: We use Solr along with Drupal for our content management needs. The
: solrconfig.xml that we have from Drupal mentions that "we do not
: spellcheck by default" and here is our request handler from
: solrconfig.xml. 
: 
: First question - why is it recommended that we do not spellcheck by
: default

"recommended" is a missleading word -- what that configuration says is 
that it won't bother to spell check unless the URL used to query 
solr includes a "spellcheck=true" param ... it's possible that something 
the Drupal UI has it's own means of deciding when to send that param.

: Secondly  - if we add spellcheck in <last-components> tag - will
: spellcheck be enabled?

in the config you pasted, it's already there -- so you shouldn't need to 
add that (but since you don't show us what the searchComponent declaration 
for your spellcheck component looks like, we have no way of guessing if 
it's entirely configured properly -- in particular there may not be 
anything building your spellcheck micro-index)

: We are using basic Solr and Drupal configurations - only now - we are
: looking at tweaking solrconfig and schema files. Any help is greatly

since Drupal packages the solr configs, you should probably consult a 
drupal list about how to enable the spell check options "the 
drupal way" before modifying the configs (i have no idea what the 
drupal/solr feature expects as far as modifications when upgrading)


-Hoss