This will be pretty much unworkable for any large corpus. The
DocumentDictionaryFactory
builds its index by reading the stored value from every document
in your index to put into a sidecar Solr index (for free text suggester).

This can take many minutes so doing this on every commit is an
anti-pattern. The suggester framework is very powerful, but not to be
used casually.

So for your situation, I'd use a copyField to a minimally-analyzed field
and use the index-based suggesters.

Best,
Erick

On Tue, Jun 30, 2015 at 9:35 AM, ssharma7...@gmail.com
<ssharma7...@gmail.com> wrote:
> Hi,
> I have the following Solr 5.1 configuration:
>
> *schema.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="suggest.dictionary">textSuggester</str>
>       <str name="suggest.dictionary">docNameSuggester</str>
>     </lst>
>     <arr name="components">
>       <str>suggest</str>
>     </arr>
>   </requestHandler>
> ......
> ......
>
>
> *Query:*
> 1) w.r.t. above configuration, is it OK to autocommit on save?
>
> I came across the a link
> http://www.signaldump.org/solr/qpod/33101/solr-suggester
> which mentions:
>
> "The index-based spellcheck/suggest just reads terms from the indexed
> fields which takes no time to build but suffers from reading indexed
> terms, i.e. terms that have gone through the analysis process that may
> have been stemmed, lowercased, all that."
>
> So, if the above is correct, the time consumed is for reading data (SELECT).
>
> P.S.I need to buildOnCommit to get the latest tokens in Suggeter. Any better
> ideas, suggestion to achieve this?
>
> Regards,
> Sachin Vyas.
>
>
>
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/Suggester-configuration-queries-tp4214950.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to