lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lajos <la...@protulae.com>
Subject Re: How to return more fields on Solr 4.5.1 Suggester?
Date Mon, 17 Mar 2014 13:28:11 GMT
Hi Omer,

That's not how its meant to work; the suggester is giving you 
potentially matching terms by looking at the set of terms for the given 
field across the index.

Possibly you want to look at the MoreLikeThis component or handler? It 
will return matching documents, from which you have access to the fields 
you want.

Regards,

Lajos


On 17/03/2014 14:05, omer sonmez wrote:
>
> I am using Solr 4.5.1 to suggest movies for my system. What i need solr to return not
only the move_title but also the movie_id that belongs to the movie. As an example; this is
kind of what i need:<response>
>      <lst name="responseHeader">
>          <int name="status">0</int>
>          <int name="QTime">1</int>
>      </lst>
>      <lst name="spellcheck">
>          <lst name="suggestions">
>              <lst name="har">
>                  <int name="numFound">6</int>
>                  <int name="startOffset">0</int>
>                  <int name="endOffset">3</int>
>                  <arr name="suggestion">
>                      <doc>
>                          <str name="name_autocomplete">hard eight (1996)</str>
>                          <str name="movie_id">144</str>
>                      </doc>
>                      <doc>
>                          <str name="name_autocomplete">hard rain (1998)</str>
>                          <str name="movie_id">14</str>
>                      </doc>
>                      <doc>
>                          <str name="name_autocomplete">harlem (1993)</str>
>                          <str name="movie_id">1044</str>
>                      </doc>
>                  </arr>
>              </lst>
>          </lst>
>      </lst>
> </response>
> My search component config is like :<searchComponent name="suggest" class="solr.SpellCheckComponent">
>      <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">name_autocomplete</str>
>          <str name="spellcheck.onlyMorePopular">true</str>
>      </lst>
> </searchComponent>
> My request hadler config is like:<requestHandler name="/suggest" class="org.apache.solr.handler.component.SearchHandler">
>      <lst name="defaults">
>          <str name="spellcheck">true</str>
>          <str name="spellcheck.dictionary">suggest</str>
>          <str name="spellcheck.count">10</str>
>      </lst>
>      <arr name="components">
>          <str>suggest</str>
>      </arr>
> </requestHandler>
> and my shema config is like below:<field name="movie_id" type="string" indexed="true"
stored="true" multiValued="false" required="true"/>
>     <field name="movie_title" type="text" indexed="true" stored="true" multiValued="false"
/>
>
>     <!--<field name="name_auto" type="text_auto" indexed="true" stored="true" multiValued="false"
/>-->
>     <field name="name_autocomplete" type="text_auto" indexed="true" stored="true"
multiValued="false" />
>
> <copyField source="movie_title" dest="name_autocomplete" />
> how can i manage to get other fiels using suggester in solr 4.5.1?
> Thanks, 		 	   		
>

Mime
View raw message