lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grigoris Iliopoulos <grigoris....@gmail.com>
Subject Re: Solr Suggester no results
Date Mon, 09 May 2016 08:40:42 GMT
Yes, i also realized  that stored="false" was the problem..It is also
stated clearly in the documentation : "To be used as the basis for a
suggestion, the field must be stored."

Thanks for your time,
Grigoris

2016-05-06 19:42 GMT+03:00 Erick Erickson <erickerickson@gmail.com>:

> First off, kudos for providing the details, that really helps!
>
> The root of your problem is that your suggest field has stored="false".
> DocumentDictionaryFactory reads through all the
> docs in your corpus, extracts the stored data and puts it in the FST. Since
> you don't have any stored data your FST is...er...minimal.
>
> I'd also add
> <str name="storeDir">suggester_fuzzy_dir</str>
> to the searchComponent. You'll find the FST on disk in that directory
> where it
> can be read next time Solr starts up. It is also helpful for figuring out
> whether there are suggestions to be had.
>
> And a minor nit, you probably don't want to specify suggest.dictionary
> in your query,
> that's already specified in your config.
>
> And it looks like you're alive to the fact that with that setup
> capitalization matters
> as does the fact that these suggestions be matched from the beginning of
> the
> field...
>
> Best,
> Erick
>
> On Thu, May 5, 2016 at 1:05 AM, Grigoris Iliopoulos
> <grigoris.csd@gmail.com> wrote:
> > Hi there,
> >
> > I want to use the Solr suggester component for city names. I have the
> > following settings:
> > schema.xml
> >
> > Field definition
> >
> > <fieldType class="solr.TextField" name="textSuggest"
> positionIncrementGap="100">
> >   <analyzer>
> >     <tokenizer class="solr.StandardTokenizerFactory"/>
> >     <filter class="solr.StandardFilterFactory"/>
> >     <filter class="solr.LowerCaseFilterFactory"/>
> >   </analyzer>
> > </fieldType>
> >
> > The field i want to apply the suggester on
> >
> > <field name="city" type="string"  indexed="true" stored="false"/>
> >
> > The copy field
> >
> > <copyField source="city" dest="citySuggest"/>
> >
> > The field
> >
> > <field name="citySuggest" type="textSuggest" stored="false"
> indexed="true" />
> >
> > solr-config.xml
> >
> > <requestHandler name="/suggest" class="solr.SearchHandler"
> startup="lazy">
> >   <lst name="defaults">
> >     <str name="suggest">true</str>
> >     <str name="suggest.count">10</str>
> >     <str name="suggest.dictionary">mySuggester</str>
> >   </lst>
> >   <arr name="components">
> >     <str>suggest</str>
> >   </arr>
> > </requestHandler>
> >
> >
> >
> > <searchComponent name="suggest" class="solr.SuggestComponent">
> >   <lst name="suggester">
> >     <str name="name">mySuggester</str>
> >     <str name="lookupImpl">FuzzyLookupFactory</str>
> >     <str name="dictionaryImpl">DocumentDictionaryFactory</str>
> >     <str name="field">citySuggest</str>
> >     <str name="suggestAnalyzerFieldType">string</str>
> >   </lst>
> > </searchComponent>
> >
> > Then i run
> >
> >
> http://localhost:8983/solr/company/suggest?suggest=true&suggest.dictionary=mySuggester&wt=json&suggest.q=Ath&suggest.build=true
> >
> > to build the suggest component
> >
> > Finally i run
> >
> >
> http://localhost:8983/solr/company/suggest?suggest=true&suggest.dictionary=mySuggester&wt=json&suggest.q=Ath
> >
> > but i get an empty result set
> >
> >
> {"responseHeader":{"status":0,"QTime":0},"suggest":{"mySuggester":{"Ath":{"numFound":0,"suggestions":[]}}}}
> >
> > Are there any obvious mistakes? Any thoughts?
>

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