tamaramata / solrnet

Automatically exported from code.google.com/p/solrnet
0 stars 0 forks source link

Suggester support #204

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I am using Solr 4.1 suggester component like this:

  <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">name_autocomplete</str>
      <str name="buildOnCommit">true</str>
    </lst>
    </searchComponent>

 <requestHandler class="org.apache.solr.handler.component.SearchHandler" name="/suggest">
   <lst name="defaults">
      <str name="spellcheck.dictionary">suggest</str>
      <str name="spellcheck">on</str>
      <str name="spellcheck.extendedResults">true</str>       
      <str name="spellcheck.count">10</str>
      <str name="spellcheck.alternativeTermCount">5</str>
      <str name="spellcheck.maxResultsForSuggest">5</str>       
      <str name="spellcheck.collate">true</str>
      <str name="spellcheck.collateExtendedResults">true</str>  
      <str name="spellcheck.maxCollationTries">10</str>
      <str name="spellcheck.maxCollations">5</str> 
   </lst>
   <arr name="components">
      <str>suggest</str>
   </arr>
</requestHandler>

I need to make solrnet to query the /suggest query handler instead of the 
/select query handler. So, sorlnet should be able to do something like:

http://127.0.0.1:8888/solr/iwant/suggest?q=java

and return:

<response><lst name="responseHeader"><int name="status">0</int><int 
name="QTime">3</int></lst><lst name="spellcheck"><lst name="suggestions"><lst 
name="jav"><int name="numFound">2</int><int name="startOffset">0</int><int 
name="endOffset">3</int><arr 
name="suggestion"><str>java</str><str>javascript</str></arr></lst><bool 
name="correctlySpelled">false</bool><lst name="collation"><str 
name="collationQuery">java</str><int name="hits">0</int><lst 
name="misspellingsAndCorrections"><str name="jav">java</str></lst></lst><lst 
name="collation"><str name="collationQuery">javascript</str><int 
name="hits">0</int><lst name="misspellingsAndCorrections"><str 
name="jav">javascript</str></lst></lst></lst></lst></response>

Is this possible using SolrNet? I don't want to rely on select qt field or 
ExtraParams for now.. since the config is already done to have a different 
request handler.

Thank you.

Original issue reported on code.google.com by cyberpun...@gmail.com on 22 Feb 2013 at 4:58

GoogleCodeExporter commented 8 years ago
See issue 141 and issue 193 . IIRC you could still use qt to select your 
request handler. Please use the google group if you have further questions.

Original comment by mauricio...@gmail.com on 2 Mar 2013 at 7:39