I've tried the new SuggestComponent, however it doesn't work quite as
expected. It returns the full field value rather than a list of corrections
for the specific term. I can see how SuggestComponent would be excellent
for phrase suggestions and document lookups, but it doesn't seem to be
suitable for a per-word spelling suggestion. Correct me if I'm wrong.

I'm taking another look at solr.SpellCheckComponenet. I've switched on
`spellcheck.extendedResults` but the response `correctlySpelled` is always
false, regardless of other settings. It seems it's an example SOLR-4278. In
that ticket James Dyer says:

> You can tell if the user's keywords exist in the index on a term-by-term
basis by specifying "spellcheck.extendedResults=true". Then look under each
<lst name="ORIG_KEYWORD"> for <int name="origFreq">0</int>.

This would be suit me perfectly - but `origFreq` does not appear in the
response at all. I'm looking that code but tracing down how the token
frequency is added is leading me down a deep and dark rabbit hole :). Am I
missing something basic here?


On Tue, Feb 11, 2014 at 3:59 PM, Areek Zillur <areek...@gmail.com> wrote:

> Dont worry about the analysis chain, I realized you are using the
> spellcheck component for suggestions. The suggestion gets returned from the
> Lucene layer, but unfortunately the Spellcheck component strips the
> suggestion out as it is mainly built for spell checking (when the query
> token == suggestion; spelling is correct, so why suggest it!). You can try
> out the SuggestComponent (SOLR-5378), it does the right thing in this
> situation.
>
>
> On Mon, Feb 10, 2014 at 9:30 PM, Areek Zillur <areek...@gmail.com> wrote:
>
> > That should not be the case, Maybe the analysis-chain of 'text_spell' is
> > doing something before the key hits the suggester (you want to use
> > something like KeywordTokenizerFactory)? Also maybe specify the
> queryAnalyzerFieldType
> > in the suggest component config? you might want to do something similar
> to
> > solr-config: (
> >
> https://github.com/apache/lucene-solr/blob/trunk/solr/core/src/test-files/solr/collection1/conf/solrconfig-phrasesuggest.xml
> )
> > [look at suggest_analyzing component] and schema: (
> >
> https://github.com/apache/lucene-solr/blob/trunk/solr/core/src/test-files/solr/collection1/conf/schema-phrasesuggest.xml
> )
> > [look at phrase_suggest field type].
> >
> >
> > On Mon, Feb 10, 2014 at 8:44 PM, Hamish Campbell <
> > hamish.campb...@koordinates.com> wrote:
> >
> >> Same issue with AnalyzingLookupFactory - I'll get autocomplete
> suggestions
> >> but not the original query.
> >>
> >>
> >> On Tue, Feb 11, 2014 at 1:57 PM, Areek Zillur <areek...@gmail.com>
> wrote:
> >>
> >> > The FuzzyLookupFactory should accept all the options as that of as
> >> > AnalyzingLookupFactory (
> >> >
> >> >
> >>
> http://lucene.apache.org/solr/4_2_1/solr-core/org/apache/solr/spelling/suggest/fst/AnalyzingLookupFactory.html
> >> > ).
> >> > [FuzzySuggester is a direct subclass of the AnalyzingSuggester in
> >> lucene].
> >> > Have you tried the exactMatchFirst with the AnalyzingLookupFactory?
> Does
> >> > AnalyzingLookup have the same problem with the exactMatchFirst option?
> >> >
> >> >
> >> > On Mon, Feb 10, 2014 at 6:00 PM, Hamish Campbell <
> >> > hamish.campb...@koordinates.com> wrote:
> >> >
> >> > > Looking at:
> >> > >
> >> > >
> >> > >
> >> >
> >>
> http://lucene.apache.org/solr/4_2_1/solr-core/org/apache/solr/spelling/suggest/fst/FuzzyLookupFactory.html
> >> > >
> >> > > It seems that exactMatchFirst is not a valid option for
> >> > FuzzyLookupFactory.
> >> > > Potential workarounds?
> >> > >
> >> > >
> >> > > On Mon, Feb 10, 2014 at 5:04 PM, Hamish Campbell <
> >> > > hamish.campb...@koordinates.com> wrote:
> >> > >
> >> > > > Hi all,
> >> > > >
> >> > > > I've got a FuzzyLookupFactory spellchecker with exactMatchFirst
> >> > enabled.
> >> > > A
> >> > > > query like "tes" will return "test" and "testing", but a query for
> >> > "test"
> >> > > > will *not* return "test" even though it is clearly in the
> >> dictionary.
> >> > Why
> >> > > > would this be?
> >> > > >
> >> > > > Relevant config follows
> >> > > >
> >> > > > <searchComponent class="solr.SpellCheckComponent" name="suggest">
> >> > > >     <lst name="spellchecker">
> >> > > >         <str name="name">suggest</str>
> >> > > >
> >> > > >         <!-- Implementation -->
> >> > > >         <str
> >> > > > name="classname">org.apache.solr.spelling.suggest.Suggester</str>
> >> > > >         <str
> >> > > >
> >> > >
> >> >
> >>
> name="lookupImpl">org.apache.solr.spelling.suggest.fst.FuzzyLookupFactory</str>
> >> > > >
> >> > > >         <!-- Properties -->
> >> > > >         <bool name="preserveSep">false</bool>
> >> > > >         <bool name="exactMatchFirst">true</bool>
> >> > > >         <str name="suggestAnalyzerFieldType">text_spell</str>
> >> > > >         <float name="threshold">0.005</float>
> >> > > >
> >> > > >         <!--
> >> > > >         Do not build on each commit, bad for performance. See
> cron.
> >> > > >         <str name="buildOnCommit">false</str>
> >> > > >         -->
> >> > > >
> >> > > >         <!-- Source -->
> >> > > >         <str name="field">suggest</str>
> >> > > >     </lst>
> >> > > > </searchComponent>
> >> > > >
> >> > > > <requestHandler name="/suggest" class="solr.SearchHandler">
> >> > > >     <lst name="defaults">
> >> > > >         <str name="spellcheck">true</str>
> >> > > >         <str name="spellcheck.dictionary">suggest</str>
> >> > > >         <str name="spellcheck.onlyMorePopular">true</str>
> >> > > >         <str name="spellcheck.count">5</str>
> >> > > >         <str name="spellcheck.collate">true</str>
> >> > > >     </lst>
> >> > > >
> >> > > >     <arr name="components">
> >> > > >         <str>suggest</str>
> >> > > >     </arr>
> >> > > > </requestHandler>
> >> > > >
> >> > > > --
> >> > > > Hamish Campbell
> >> > > > Koordinates Ltd <http://koordinates.com/?_bzhc=esig>
> >> > > > PH   +64 9 966 0433
> >> > > > FAX +64 9 966 0045
> >> > > >
> >> > >
> >> > >
> >> > >
> >> > > --
> >> > > Hamish Campbell
> >> > > Koordinates Ltd <http://koordinates.com/?_bzhc=esig>
> >> > > PH   +64 9 966 0433
> >> > > FAX +64 9 966 0045
> >> > >
> >> >
> >>
> >>
> >>
> >> --
> >> Hamish Campbell
> >> Koordinates Ltd <http://koordinates.com/?_bzhc=esig>
> >> PH   +64 9 966 0433
> >> FAX +64 9 966 0045
> >>
> >
> >
>



-- 
Hamish Campbell
Koordinates Ltd <http://koordinates.com/?_bzhc=esig>
PH   +64 9 966 0433
FAX +64 9 966 0045

Reply via email to