lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: questions on Solr WordBreakSolrSpellChecker and WordDelimiterFilterFactory
Date Fri, 18 Jul 2014 01:57:17 GMT
Zeroth, take a look at the admin/analysis page with that input and see if
your
field in analyzing x-box and xbox like you expect.

First, try adding &debug=all to the URL, that'll show you exactly what the
parsed query
was. It may surprise you.

Second, examine what's actually _in_ the index with the
admin/schema-browser or
TermsComponent or Luke to see if _that's_ what you expect.

My bet is it'll be pretty obvious in one of those three steps... but I've
lost bets before.


On Thu, Jul 17, 2014 at 5:42 AM, <jiag@ece.ubc.ca> wrote:

> Hi Ahmet,
>
> using <arr name="last-components"> or <arr name="components"> didn't
> make any difference. Still running into the same issues aforementioned :(
>
> Thanks,
> Jia
>
> On 7/16/2014, "Ahmet Arslan" <iorixxx@yahoo.com> wrote:
>
> >Hi Jia,
> >
> >What happens when you use
> >
> > <arr name="last-components">
> >
> >instead of
> >
> > <arr name="components">
> >
> >Ahmet
> >
> >
> >On Wednesday, July 16, 2014 3:07 AM, "jiag@ece.ubc.ca" <jiag@ece.ubc.ca>
> wrote:
> >
> >
> >
> >Hello everyone :)
> >
> >I have a product called "xbox" indexed, and when the user search for
> >either "x-box" or "x box" i want the "xbox" product to be
> >returned.  I'm new to Solr, and from reading online, I thought I need
> >to use WordDelimiterFilterFactory for "x-box" case, and
> >WordBreakSolrSpellChecker for "x box" case. Is this correct?
> >
> >(1) In my schema file, this is what I changed:
> ><filter class="solr.WordDelimiterFilterFactory" generateWordParts="1"
> >generateNumberParts="1" catenateWords="1" catenateNumbers="1"
> >catenateAll="1" splitOnCaseChange="0" preserveOriginal="1"/>
> >
> >But I don't see the xbox product returned when the search term is
> >"x-box", so I must have missed something....
> >
> >(2) I tried to use  WordBreakSolrSpellChecker together with
> >DirectSolrSpellChecker as shown below, but the WordBreakSolrSpellChecker
> >never got used:
> >
> ><searchComponent name="wc_spellcheck"
> >class="solr.SpellCheckComponent">
> >    <str name="queryAnalyzerFieldType">wc_textSpell</str>
> >
> >    <lst name="spellchecker">
> >      <str name="name">default</str>
> >      <str name="field">spellCheck</str>
> >      <str name="classname">solr.DirectSolrSpellChecker</str>
> >      <str name="distanceMeasure">internal</str>
> >          <float name="accuracy">0.3</float>
> >            <int name="maxEdits">2</int>
> >            <int name="minPrefix">1</int>
> >            <int name="maxInspections">5</int>
> >            <int name="minQueryLength">3</int>
> >            <float name="maxQueryFrequency">0.01</float>
> >            <float name="thresholdTokenFrequency">0.004</float>
> >    </lst>
> ><lst name="spellchecker">
> >    <str name="name">wordbreak</str>
> >    <str name="classname">solr.WordBreakSolrSpellChecker</str>
> >    <str name="field">spellCheck</str>
> >    <str name="combineWords">true</str>
> >    <str name="breakWords">true</str>
> >    <int name="maxChanges">10</int>
> >  </lst>
> >  </searchComponent>
> >
> >  <requestHandler name="/spellcheck"
> >class="org.apache.solr.handler.component.SearchHandler">
> >    <lst name="defaults">
> >        <str name="df">SpellCheck</str>
> >        <str name="spellcheck">true</str>
> >           <str name="spellcheck.dictionary">default</str>
> >        <str name="spellcheck.dictionary">wordbreak</str>
> >        <str name="spellcheck.build"> true</str>
> >           <str name="spellcheck.onlyMorePopular">false</str>
> >           <str name="spellcheck.count">10</str>
> >           <str name="spellcheck.collate">true</str>
> >           <str name="spellcheck.collateExtendedResults">false</str>
> >    </lst>
> >    <arr name="components">
> >      <str>wc_spellcheck</str>
> >    </arr>
> >  </requestHandler>
> >
> >I tried to build the dictionary this way:
> >
> http://localhost/solr/coreName/select?spellcheck=true&spellcheck.build=true
> ,
> >but the response returned is this:
> ><response>
> ><lst name="responseHeader">
> ><int name="status">0</int>
> ><int name="QTime">0</int>
> ><lst name="params">
> ><str name="spellcheck.build">true</str>
> ><str name="spellcheck">true</str>
> ></lst>
> ></lst>
> ><str name="command">build</str>
> ><result name="response" numFound="0" start="0"/>
> ></response>
> >
> >What's the correct way to build the dictionary?
> >Even though my requestHandler's name="/spellcheck", i wasn't able to
> >use
> >
> http://localhost/solr/coreName/spellcheck?spellcheck=true&spellcheck.build=true
> >.. is there something wrong with my definition above?
> >
> >(3) I also tried to use WordBreakSolrSpellChecker without the
> >DirectSolrSpellChecker as shown below:
> ><searchComponent name="wc_spellcheck"
> >class="solr.SpellCheckComponent">
> >
> >  <str name="queryAnalyzerFieldType">wc_textSpell</str>
> >    <lst name="spellchecker">
> >    <str name="name">default</str>
> >    <str name="classname">solr.WordBreakSolrSpellChecker</str>
> >    <str name="field">spellCheck</str>
> >    <str name="combineWords">true</str>
> >    <str name="breakWords">true</str>
> >    <int name="maxChanges">10</int>
> >  </lst>
> >   </searchComponent>
> >
> >   <requestHandler name="/spellcheck"
> >class="org.apache.solr.handler.component.SearchHandler">
> >    <lst name="defaults">
> >        <str name="df">SpellCheck</str>
> >        <str name="spellcheck">true</str>
> >           <str name="spellcheck.dictionary">default</str>
> >        <!--<str name="spellcheck.dictionary">wordbreak</str> -->
> >        <str name="spellcheck.build"> true</str>
> >           <str name="spellcheck.onlyMorePopular">false</str>
> >           <str name="spellcheck.count">10</str>
> >           <str name="spellcheck.collate">true</str>
> >           <str name="spellcheck.collateExtendedResults">false</str>
> >    </lst>
> >    <arr name="components">
> >      <str>wc_spellcheck</str>
> >    </arr>
> >  </requestHandler>
> >
> >And still unable to see WordBreakSolrSpellChecker being called anywhere.
> >
> >Would someone kindly help me?
> >
> >Many thanks,
> >Jia
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message