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 sasho <a....@gmail.com> on 2012/11/21 15:21:28 UTC

solr autocomplete

Hi all,

I'am using the apache-solr4.0.0, and the autocomplete feature. In general it
works fine, but I still have two problems which I can't solve. In general I
need the autocomplete to show a movie titles.

1. The first thing is that the autocomplete search ignores all characters
after the space.
For example when I search for the word "the" I get the "the matrix" and "the
girl next door". And when I type "the m" instead of getting only "the
matrix", the server keep returning the previous two results. It seems that
the search has been proceed only fro the first token. 
I red a post here which says that the solution can be implementing a custom
QueryConverter for it, but I also sow that there is a SuggestQueryConverter
which may do the same?

2. The second problem I have is configuring an autocompletion to suggest not
only movie titles starting with the searched string but also titles which
has this string in the middle of the title. 
For example when i type "tibet" to get a suggestion not only for "tibet and
tibetan" but also for "seven years in tibet". Is this possible at all?

Here is my configuration:

schema.xml

<field name="title" type="text_general" indexed="true" stored="true"
multiValued="true"/>
<field name="title_autocomplete" type="lowercase_de" indexed="true"
stored="true" multiValued="true" />    
<copyField source="title" dest="title_autocomplete" />

<fieldType name="lowercase_de" class="solr.TextField">
	<analyzer>
        	<tokenizer class="solr.KeywordTokenizerFactory"/>
        	<filter class="solr.LowerCaseFilterFactory" />
      </analyzer>
</fieldType>


config.xml

  <searchComponent class="solr.SpellCheckComponent" name="suggest">
    <lst name="spellchecker">
      <str name="name">suggest</str>
      <str name="classname">org.apache.solr.spelling.suggest.Suggester</str>
      <str
name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str>
      
      <str name="field">title_autocomplete</str>
      <str name="field">title</str>
        
    </lst>
  </searchComponent>

 <requestHandler class="org.apache.solr.handler.component.SearchHandler"
name="/suggest">
    <lst name="defaults">
      <str name="spellcheck">true</str>
      <str name="spellcheck.dictionary">suggest</str>
      <str name="spellcheck.onlyMorePopular">true</str>
      <str name="spellcheck.count">10</str>
      <str name="spellcheck.collate">false</str>
    </lst>
    <arr name="components">
      <str>suggest</str>
    </arr>
  </requestHandler>


Thank you.




--
View this message in context: http://lucene.472066.n3.nabble.com/solr-autocomplete-tp4021587.html
Sent from the Solr - User mailing list archive at Nabble.com.