lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincenzo D'Amore" <v.dam...@gmail.com>
Subject Re: Solr Suggester not working.
Date Tue, 30 Jun 2015 13:07:11 GMT
Thanks Sachin Vyas.

Maybe I have found a typo, but there is a closed comment "-->" alone at end
of tag

<str name="spellcheck.collate">false</str> -->



On Tue, Jun 30, 2015 at 2:09 PM, ssharma7884@gmail.com <
ssharma7884@gmail.com> wrote:

> Vincenzo D'Amore,
> The following is my (CURRENT) Working Final Configuration:
>
> *Scheme.xml*
> <fields>
> .....
> .....
> <field name="text" type="c_text" indexed="true" stored="true"
> termVectors="true" termPositions="true" termOffsets="true" />
> <field name="document_name" type="c_document_name" indexed="true"
> stored="true" required="true" multiValued="false" />
> .....
> .....
> </fields>
>
> <types>
> .....
> .....
>
>                 <fieldType name="c_text" class="solr.TextField"
> positionIncrementGap="100">
>                         <analyzer type="index">
>                                 <tokenizer
> class="solr.UAX29URLEmailTokenizerFactory"/>
>                                 <filter class="solr.StopFilterFactory"
> ignoreCase="true"
> words="lang/stopwords_en.txt" />
>                                 <filter
> class="solr.ASCIIFoldingFilterFactory"/>
>                                 <filter
> class="solr.EnglishPossessiveFilterFactory"/>
>                                 <filter
> class="solr.RemoveDuplicatesTokenFilterFactory"/>
>                                 <filter class="solr.TrimFilterFactory"/>
>                                 <filter
> class="solr.LowerCaseFilterFactory"/>
>                         </analyzer>
>                         <analyzer type="query">
>                                 <tokenizer
> class="solr.UAX29URLEmailTokenizerFactory"/>
>                                 <filter class="solr.StopFilterFactory"
> ignoreCase="true"
> words="lang/stopwords_en.txt" />
>                                 <filter
> class="solr.ASCIIFoldingFilterFactory"/>
>                                 <filter
> class="solr.EnglishPossessiveFilterFactory"/>
>                                 <filter
> class="solr.LowerCaseFilterFactory"/>
>                         </analyzer>
>                 </fieldType>
>
>                 <fieldType name="c_document_name" class="solr.TextField"
> positionIncrementGap="100">
>                         <analyzer type="index">
>                                 <tokenizer
> class="solr.KeywordTokenizerFactory"/>
>                                 <filter
> class="solr.LowerCaseFilterFactory"/>
>                         </analyzer>
>                         <analyzer type="query">
>                                 <tokenizer
> class="solr.KeywordTokenizerFactory"/>
>                                 <filter
> class="solr.LowerCaseFilterFactory"/>
>                         </analyzer>
>                 </fieldType>
>
> .....
> .....
> </types>
>
>
> *solrconfig.xml*
> ......
> ......
> <searchComponent name="suggest" class="solr.SuggestComponent">
>    <lst name="suggester">
>       <str name="name">textSuggester</str>
>       <str name="lookupImpl">FreeTextLookupFactory</str>
>       <str name="dictionaryImpl">DocumentDictionaryFactory</str>
>       <str name="field">text</str>
>       <str name="suggestFreeTextAnalyzerFieldType">c_text</str>
>       <str name="buildOnCommit">true</str>
>    </lst>
>    <lst name="suggester">
>       <str name="name">docNameSuggester</str>
>       <str name="lookupImpl">FreeTextLookupFactory</str>
>       <str name="dictionaryImpl">DocumentDictionaryFactory</str>
>       <str name="field">document_name</str>
>       <str name="suggestFreeTextAnalyzerFieldType">c_document_name</str>
>       <str name="buildOnCommit">true</str>
>    </lst>
> </searchComponent>
>
>   <requestHandler name="/suggestHandler" class="solr.SearchHandler"
>                   startup="lazy" >
>     <lst name="defaults">
>       <str name="wt">json</str>
>       <str name="suggest">true</str>
>       <str name="suggest.count">5</str>
>       <str name="spellcheck.collate">false</str>-->
>
>       <str name="suggest.dictionary">textSuggester</str>
>       <str name="suggest.dictionary">docNameSuggester</str>
>     </lst>
>     <arr name="components">
>       <str>suggest</str>
>     </arr>
>   </requestHandler>
> ......
> ......
>
> *Solr Query URL*
>
> http://localhost:8983/solr/collection1/suggestHandler?&wt=xml&suggest.q=document
>
> *Suggester Output*
> <?xml version="1.0" encoding="UTF-8"?>
> <response>
>
> <lst name="responseHeader">
>   <int name="status">0</int>
>   <int name="QTime">16</int>
> </lst>
> <lst name="suggest">
>   <lst name="docNameSuggester">
>     <lst name="document">
>       <int name="numFound">5</int>
>       <arr name="suggestions">
>         <lst>
>           <str name="term">document</str>
>           <long name="weight">512409557603043072</long>
>           <str name="payload"/>
>         </lst>
>         <lst>
>           <str name="term">document1</str>
>           <long name="weight">512409557603043072</long>
>           <str name="payload"/>
>         </lst>
>         <lst>
>           <str name="term">document2</str>
>           <long name="weight">512409557603043072</long>
>           <str name="payload"/>
>         </lst>
>         <lst>
>           <str name="term">document3</str>
>           <long name="weight">512409557603043072</long>
>           <str name="payload"/>
>         </lst>
>         <lst>
>           <str name="term">document4</str>
>           <long name="weight">512409557603043072</long>
>           <str name="payload"/>
>         </lst>
>       </arr>
>     </lst>
>   </lst>
>   <lst name="textSuggester">
>     <lst name="document">
>       <int name="numFound">3</int>
>       <arr name="suggestions">
>         <lst>
>           <str name="term">document</str>
>           <long name="weight">10933347601771902</long>
>           <str name="payload"/>
>         </lst>
>         <lst>
>           <str name="term">documents</str>
>           <long name="weight">4373339040708760</long>
>           <str name="payload"/>
>         </lst>
>         <lst>
>           <str name="term">documenting</str>
>           <long name="weight">2186669520354380</long>
>           <str name="payload"/>
>         </lst>
>       </arr>
>     </lst>
>   </lst>
> </lst>
> </response>
>
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Solr-Suggester-not-working-tp4214086p4214929.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Vincenzo D'Amore
email: v.damore@gmail.com
skype: free.dev
mobile: +39 349 8513251

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