Isn't your phrase_suggest analyzer always going to treat every input string as one single token, and that single token is what the suggester is returning? And, that single token starts with "th", not "lab"? Is that what you want?

Try using the Solr admin UI analyzer page to verify how the analyzer is working.

-- Jack Krupansky

-----Original Message----- From: Mysurf Mail
Sent: Thursday, August 15, 2013 4:32 AM
To: solr-user@lucene.apache.org
Subject: Troubles defining suggester/ understanding results

I am having troubles defining suggester for auto complete after reading the
tutorial.

Here are my shcema definitions:

<field name="PackageName" type="text_en" indexed="true" stored="true"
required="true"/>
<field name="PackageVersionComments" type="text_en" indexed="true"
stored="true" required="false"/>
...
<field name="SKUDescription" type="text_en" indexed="true"
stored="true" required="false" multiValued="true"/>

I also added two field types

<fieldtype name="text" class="solr.TextField">
 <analyzer>
   <tokenizer class="solr.StandardTokenizerFactory"/>
   <filter class="solr.LowerCaseFilterFactory"/>
 </analyzer>
</fieldtype>


<fieldtype name="phrase_suggest" class="solr.TextField">
 <analyzer>
   <tokenizer class="solr.KeywordTokenizerFactory"/>
   <filter class="solr.PatternReplaceFilterFactory"
           
pattern="([^\p{L}\p{M}\p{N}\p{Cs}]*[\p{L}\p{M}\p{N}\p{Cs}\_]+:)|([^\p{L}\p{M}\p{N}\p{Cs}])+"
           replacement=" " replace="all"/>
   <filter class="solr.LowerCaseFilterFactory"/>
   <filter class="solr.TrimFilterFactory"/>
 </analyzer>
</fieldtype>

Now since I want to make suggestions from multiple fields and I cant
declare two fields I defined :

and copied three of the fields using :

Problems:
1. everything loads pretty well. but copying the fields to a new fields
just inflate my index. is there a possiblity to define the suggester on
mopre then one field? 2. I cant understand the results. querying

http://127.0.0.1:8983/solr/Book/suggest?q=th

returns docs such as
"that are labelled in black on a black background a little black light"
though quering

http://127.0.0.1:8983/solr/vault-Book/suggest?q=lab

doesnt return anything.
lab is found in the previous result as well.
What is the problem?

Reply via email to