lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From benjelloun <anass....@gmail.com>
Subject Solr 4.7.2 auto suggestion
Date Thu, 17 Jul 2014 16:01:07 GMT
Hello,

i'm trying to do auto suggestion but thats not working.
here is my configuration:

schema:

<field name="spell"  type="textSpell" multiValued="true" indexed="true"
required="false" stored="false"/>
<copyField source="*_en" dest="spell"/>
 <copyField source="*_fr" dest="spell"/>
 <copyField source="*_ar" dest="spell"/>

<fieldType name="textSpell" class="solr.TextField"
positionIncrementGap="100" omitNorms="true">
        <analyzer type="index">
        <tokenizer class="solr.StandardTokenizerFactory"/>
		
        <filter class="solr.PatternReplaceFilterFactory"
pattern="^(\p{Punct}*)(.*?)(\p{Punct}*)$" replacement="$2"/>
		
        <filter class="solr.LengthFilterFactory" min="3" max="20" />
		
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
        <filter class="solr.StopFilterFactory" words="stopwords.txt"
ignoreCase="true"/>
        <filter class="solr.StandardFilterFactory"/>   
			
		
        </analyzer>
		
        <analyzer type="query">
        <tokenizer class="solr.StandardTokenizerFactory"/>
		
        <filter class="solr.PatternReplaceFilterFactory"
pattern="^(\p{Punct}*)(.*?)(\p{Punct}*)$" replacement="$2"/>
		
        <filter class="solr.LengthFilterFactory" min="3" max="20" />
		
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
        <filter class="solr.StopFilterFactory" words="stopwords.txt"
ignoreCase="true"/>
        <filter class="solr.StandardFilterFactory"/>
		
        </analyzer>
    </fieldType>

SolrConfig:

<requestHandler name="/selects" class="solr.SearchHandler">
<lst name="defaults">
       <str name="echoParams">explicit</str>
       <int name="rows">10</int>
       
	   <str name="defType">edismax</str>
       <str name="qf">
	   AllChamp^2.0 AllChamp_ar^2.0 AllChamp_en^2.0 AllChamp_fr^5.0
	   </str>
	   <bool name="stopwords">true</bool>
	   <str name="q.op">AND</str>
<str name="suggest.dictionary">mySuggester</str>
	    <str name="suggest">on</str>
	    <str name="name">mySuggester</str>
        <str name="dictionaryImpl">DocumentDictionaryFactory</str>
        <str name="lookupImpl">FuzzyLookupFactory</str>
        <str name="field">spell</str>
<str name="strtoreDir">suggestion</str>
        <str name="suggestAnalyzerFieldType">textSpell</str>

	  
	  <str name="suggest">true</str>
	  <str name="suggest.build">true</str>
      <str name="suggest.count">6</str>
    </lst>
	<arr name="last-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">spell</str>
      <str name="weightField">IdDocument</str>
	  <str name="storeDir">suggestion</str>
      <str name="suggestAnalyzerFieldType">text_general</str>
    </lst>
  </searchComponent>

Thanks best regards :)






--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-4-7-2-auto-suggestion-tp4147677.html
Sent from the Solr - User mailing list archive at Nabble.com.

Mime
View raw message