I filed issue SOLR-7144 with the patch attached.   It's probably best to get 
some feedback from developers.  It may not be the right approach, etc.

Also, spellcheck.maxCollationTries > 0 is the parameter needed to get collation 
results that respect the current filter queries, etc.

Set spellcheck.maxCollations > 1 to get multiple collation results.   However, 
if the original query has only a single term, there will be no collation 
results.   Thus, for single term queries, you need to look at the original 
frequency information to determine if the original term is valid or not.   
There may be spellcheck suggestions even for terms with origFreq > 0.

-----Original Message-----
From: Nitin Solanki [mailto:nitinml...@gmail.com] 
Sent: Monday, February 23, 2015 11:35 AM
To: solr-user@lucene.apache.org
Subject: Re: Collations are not working fine.

Hi Charles,
             How you patch the suggester to get frequency information in the 
spellcheck response?
It's very good. I also want to do that?


On Mon, Feb 16, 2015 at 7:59 PM, Reitzel, Charles < 
charles.reit...@tiaa-cref.org> wrote:

> I have been working with collations the last couple days and I kept adding
> the collation-related parameters until it started working for me.   It
> seems I needed <str name="spellcheck.collateMaxCollectDocs">50</str>.
>
> But, I am using the Suggester with the WFSTLookupFactory.
>
> Also, I needed to patch the suggester to get frequency information in 
> the spellcheck response.
>
> -----Original Message-----
> From: Rajesh Hazari [mailto:rajeshhaz...@gmail.com]
> Sent: Friday, February 13, 2015 3:48 PM
> To: solr-user@lucene.apache.org
> Subject: Re: Collations are not working fine.
>
> Hi Nitin,
>
> Can u try with the below config, we have these config seems to be 
> working for us.
>
> <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
>
>      <str name="queryAnalyzerFieldType">text_general</str>
>
>
>   <lst name="spellchecker">
> <str name="name">wordbreak</str>
> <str name="classname">solr.WordBreakSolrSpellChecker</str>
> <str name="field">textSpell</str>
> <str name="combineWords">true</str>
> <str name="breakWords">false</str>
> <int name="maxChanges">5</int>
>   </lst>
>
>    <lst name="spellchecker">
> <str name="name">default</str>
> <str name="field">textSpell</str>
> <str name="classname">solr.IndexBasedSpellChecker</str>
> <str name="spellcheckIndexDir">./spellchecker</str>
> <str name="accuracy">0.75</str>
> <float name="thresholdTokenFrequency">0.01</float>
> <str name="buildOnCommit">true</str>
> <str name="spellcheck.maxResultsForSuggest">5</str>
>      </lst>
>
>
>   </searchComponent>
>
>
>
> <str name="spellcheck">true</str>
> <str name="spellcheck.dictionary">default</str>
> <str name="spellcheck.dictionary">wordbreak</str>
> <int name="spellcheck.count">5</int>
> <str name="spellcheck.alternativeTermCount">15</str>
> <str name="spellcheck.collate">true</str>
> <str name="spellcheck.onlyMorePopular">false</str>
> <str name="spellcheck.extendedResults">true</str>
> <str name ="spellcheck.maxCollations">100</str>
> <str name="spellcheck.collateParam.mm">100%</str>
> <str name="spellcheck.collateParam.q.op">AND</str>
> <str name="spellcheck.maxCollationTries">1000</str>
>
>
> *Rajesh.*
>
> On Fri, Feb 13, 2015 at 1:01 PM, Dyer, James 
> <james.d...@ingramcontent.com
> >
> wrote:
>
> > Nitin,
> >
> > Can you post the full spellcheck response when you query:
> >
> > q=gram_ci:"gone wthh thes wint"&wt=json&indent=true&shards.qt=/spell
> >
> > James Dyer
> > Ingram Content Group
> >
> >
> > -----Original Message-----
> > From: Nitin Solanki [mailto:nitinml...@gmail.com]
> > Sent: Friday, February 13, 2015 1:05 AM
> > To: solr-user@lucene.apache.org
> > Subject: Re: Collations are not working fine.
> >
> > Hi James Dyer,
> >                           I did the same as you told me. Used 
> > WordBreakSolrSpellChecker instead of shingles. But still collations 
> > are not coming or working.
> > For instance, I tried to get collation of "gone with the wind" by 
> > searching "gone wthh thes wint" on field=gram_ci but didn't succeed.
> > Even, I am getting the suggestions of wtth as *with*, thes as *the*,
> wint as *wind*.
> > Also I have documents which contains "gone with the wind" having 167 
> > times in the documents. I don't know that I am missing something or not.
> > Please check my below solr configuration:
> >
> > *URL: *localhost:8983/solr/wikingram/spell?q=gram_ci:"gone wthh thes 
> > wint"&wt=json&indent=true&shards.qt=/spell
> >
> > *solrconfig.xml:*
> >
> > <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
> >     <str name="queryAnalyzerFieldType">textSpellCi</str>
> >     <lst name="spellchecker">
> >       <str name="name">default</str>
> >       <str name="field">gram_ci</str>
> >       <str name="classname">solr.DirectSolrSpellChecker</str>
> >       <str name="distanceMeasure">internal</str>
> >       <float name="accuracy">0.5</float>
> >       <int name="maxEdits">2</int>
> >       <int name="minPrefix">0</int>
> >       <int name="maxInspections">5</int>
> >       <int name="minQueryLength">2</int>
> >       <float name="maxQueryFrequency">0.9</float>
> >       <str name="comparatorClass">freq</str>
> >     </lst>
> > <lst name="spellchecker">
> >       <str name="name">wordbreak</str>
> >       <str name="classname">solr.WordBreakSolrSpellChecker</str>
> >       <str name="field">gram</str>
> >       <str name="combineWords">true</str>
> >       <str name="breakWords">true</str>
> >       <int name="maxChanges">5</int>
> >     </lst>
> > </searchComponent>
> >
> > <requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
> >     <lst name="defaults">
> >       <str name="df">gram_ci</str>
> >       <str name="spellcheck.dictionary">default</str>
> >       <str name="spellcheck">on</str>
> >       <str name="spellcheck.extendedResults">true</str>
> >       <str name="spellcheck.count">25</str>
> >       <str name="spellcheck.onlyMorePopular">true</str>
> >       <str name="spellcheck.maxResultsForSuggest">100000000</str>
> >       <str name="spellcheck.alternativeTermCount">25</str>
> >       <str name="spellcheck.collate">true</str>
> >       <str name="spellcheck.maxCollations">50</str>
> >       <str name="spellcheck.maxCollationTries">50</str>
> >       <str name="spellcheck.collateExtendedResults">true</str>
> >     </lst>
> >     <arr name="last-components">
> >       <str>spellcheck</str>
> >     </arr>
> >   </requestHandler>
> >
> > *Schema.xml: *
> >
> > <field name="gram_ci" type="textSpellCi" indexed="true" stored="true"
> > multiValued="false"/>
> >
> > </fieldType><fieldType name="textSpellCi" class="solr.TextField"
> > positionIncrementGap="100">
> >        <analyzer type="index">
> >         <tokenizer class="solr.StandardTokenizerFactory"/>
> >         <filter class="solr.LowerCaseFilterFactory"/>
> > </analyzer>
> >     <analyzer type="query">
> >         <tokenizer class="solr.StandardTokenizerFactory"/>
> >         <filter class="solr.LowerCaseFilterFactory"/>
> > </analyzer>
> > </fieldType>
> >
>
> **********************************************************************
> *** This e-mail may contain confidential or privileged information.
> If you are not the intended recipient, please notify the sender 
> immediately and then delete it.
>
> TIAA-CREF
> **********************************************************************
> ***
>

*************************************************************************
This e-mail may contain confidential or privileged information.
If you are not the intended recipient, please notify the sender immediately and 
then delete it.

TIAA-CREF
*************************************************************************

Reply via email to