You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by benjelloun <an...@gmail.com> on 2014/07/17 18:01:07 UTC

Solr 4.7.2 auto suggestion

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.

Re: Solr 4.7.2 auto suggestion

Posted by benjelloun <an...@gmail.com>.
the dictionary file named : "fwfsta.bin" contain NULL.
thats mean the configuration is not correct.
maybe i need to add or change somthing on <fieldType name="textSpell" .../>

thanks for help



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

Re: Solr 4.7.2 auto suggestion

Posted by benjelloun <an...@gmail.com>.
Hello,
 the suggester "solr.SuggestComponent"
with 
<str name="lookupImpl">FuzzyLookupFactory</str>      
<str name="dictionaryImpl">DocumentDictionaryFactory</str>

Dont work with type of fields which are not string and  multivalued.

any idea ?




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

Re: Solr 4.7.2 auto suggestion

Posted by benjelloun <an...@gmail.com>.
Hello,

In Solr Admin i put on /selects:

q="indexa",
it should auto suggest "indexation" and other suggestion if existe.

i have this response:
{ "responseHeader": { "status": 0, "QTime": 169, "params": { "indent":
"true", "q": "indexa", "_": "1405671103093", "wt": "json" } }, "command":
"build", "response": { "numFound": 0, "start": 0, "docs": [] }, "suggest": {
"mySuggester": { "indexa": { "numFound": 0, "suggestions": [] } } } }

I checked my doctionary file --> empty i don't know why.
is my configuration correct for Solr 4.7.2?






2014-07-18 2:37 GMT+02:00 Alexandre Rafalovitch [via Lucene] <
ml-node+s472066n4147798h63@n3.nabble.com>:

> On Thu, Jul 17, 2014 at 11:01 PM, benjelloun <[hidden email]
> <http://user/SendEmail.jtp?type=node&node=4147798&i=0>> wrote:
> > i'm trying to do auto suggestion but thats not working.
>
> Not working specifically how? What do you put in, what did you get
> back, what did you expect?
>
> Regards,
>    Alex.
>
> Personal: http://www.outerthoughts.com/ and @arafalov
> Solr resources: http://www.solr-start.com/ and @solrstart
> Solr popularizers community: https://www.linkedin.com/groups?gid=6713853
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://lucene.472066.n3.nabble.com/Solr-4-7-2-auto-suggestion-tp4147677p4147798.html
>  To unsubscribe from Solr 4.7.2 auto suggestion, click here
> <http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4147677&code=YW5hc3MuYm5qQGdtYWlsLmNvbXw0MTQ3Njc3fC0xMDQyNjMzMDgx>
> .
> NAML
> <http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




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

Re: Solr 4.7.2 auto suggestion

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
On Thu, Jul 17, 2014 at 11:01 PM, benjelloun <an...@gmail.com> wrote:
> i'm trying to do auto suggestion but thats not working.

Not working specifically how? What do you put in, what did you get
back, what did you expect?

Regards,
   Alex.

Personal: http://www.outerthoughts.com/ and @arafalov
Solr resources: http://www.solr-start.com/ and @solrstart
Solr popularizers community: https://www.linkedin.com/groups?gid=6713853