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 Damien Picard <pi...@gmail.com> on 2016/01/28 11:07:21 UTC

Unable to query the spellchecker in a distributed way

Hi,

We are using SolrCloud (4 nodes) and we have defined a suggester using the
spellcheck component.

The suggester is defined as :

<searchComponent class="solr.SpellCheckComponent" name="suggest">
      <lst name="spellchecker">
        <str name="name">suggestOpeGes</str>
        <str
name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str>
        <str
name="classname">org.apache.solr.spelling.suggest.Suggester</str>
        <str name="field">ref_opegestion</str>
        <float name="threshold">0</float>
        <str name="buildOnCommit">true</str>
        <str name="buildOnOptimize">true</str>
      </lst>
      <lst name="spellchecker">
        <str name="name">suggestRefCre</str>
        <str
name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str>
        <str
name="classname">org.apache.solr.spelling.suggest.Suggester</str>
        <str name="field">ref_cre</str>
        <float name="threshold">0</float>
        <str name="buildOnCommit">true</str>
        <str name="buildOnOptimize">true</str>
      </lst>
      <lst name="spellchecker">
        <str name="name">suggestRefEcr</str>
        <str
name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str>
        <str
name="classname">org.apache.solr.spelling.suggest.Suggester</str>
        <str name="field">ref_ecriture</str>
        <float name="threshold">0</float>
        <str name="buildOnCommit">true</str>
        <str name="buildOnOptimize">true</str>
      </lst>
  </searchComponent>
  <requestHandler class="solr.SearchHandler" name="/suggest" startup="lazy">
    <lst name="defaults">
        <str name="spellcheck">true</str>
        <str name="spellcheck.dictionary">suggestOpeGes</str>
        <str name="spellcheck.count">20</str>
        <str name="spellcheck.collate">true</str>
        <str name="spellcheck.onlyMorePopular">false</str>
    </lst>
    <arr name="components">
      <str>suggest</str>
    </arr>
  </requestHandler>

When I query this collection suggest with the shards parameters :
GET
/solr/ppd_piste_audit_gsie_traite_001/suggest?q=GSIEBBA&wt=json&indent=true&spellcheck=true&spellcheck.dictionary=suggestOpeGes&shards.qt=suggest/

I get no results :

{
  "responseHeader":{
    "status":0,
    "QTime":0}}

But, when I disable the distributed search :
GET
/solr/ppd_piste_audit_gsie_traite_001/suggest?q=GSIEMMA&wt=json&indent=true&spellcheck=true&spellcheck.dictionary=suggestOpeGes&distrib=false

I get the results I expect :

{
  "responseHeader":{
    "status":0,
    "QTime":28},
  "spellcheck":{
    "suggestions":[
      "GSIEBBA",{
        "numFound":20,
        "startOffset":0,
        "endOffset":7,
        "suggestion":["GSIEMMA44257700010010401",
          "GSIEBBA64257700010013501",
          "GSIEBBA70723503779040201",
          "GSIEBBA71257700030012101",
          "GSIEBBA71723503830023601",
          "GSIEBBA74001300670011701",
          "GSIEBBA74001300670011801",
          "GSIEBBA74772000136021201",
          "GSIEBBA76257700040010501",
          "GSIEBBA76600101133030501",
          "GSIEBBA76680400195030601",
          "GSIEBBA77692100093024401",
          "GSIEBBA77692100093024501",
          "GSIEBBA78450700227020701",
          "GSIEBBA78450700227020801",
          "GSIEBBA78854102439020301",
          "GSIEBBA78854102439020401",
          "GSIEBBA79441700201040401",
          "GSIEBBA79723504720012701",
          "GSIEBBA79763600779010501"]},
      "collation","GSIEBBA44257700010010401"]}}

I also try to send a "manually" distributed search without success :

GET
/solr/ppd_piste_audit_gsie_traite_001-000003_shard1_replica2/suggest?q=GSIEMMA&qt=suggest&wt=json&indent=true&spellcheck=true&spellcheck.dictionary=suggestOpeGes&shards.qt=suggest/&shards=dn330003.xxx.priv:8983/solr/ppd_piste_audit_gsie_traite_001-000003_shard2_replica1/|dn330004.xxx.priv:8983/solr/ppd_piste_audit_gsie_traite_001-000003_shard1_replica1/

What am I doing wrong ?

Thank you.
-- 
Damien Picard
Expert GWT
<http://www.editions-eni.fr/livres/gwt-google-web-toolkit-developpez-des-applications-internet-riches-ria-en-java/.97a1a26e7d5be94763fc45ac2a1e961a.html>
Mob : 06 11 51 47 78

Re: Unable to query the spellchecker in a distributed way

Posted by Damien Picard <pi...@gmail.com>.
I got it ; in Solr 4.4, the component
org.apache.solr.handler.component.SpellCheckComponent
didn't implement the method
distributedProcess(ResponseBuilder rb) which is necessary to
org.apache.solr.handler.component.SearchHandler to handle distributed
searches the right way.

And it seems that with 4.10, the SpellCheckComponent did not too...

Do you have a workaround for these versions ?


2016-01-28 14:20 GMT+01:00 Damien Picard <pi...@gmail.com>:

> (we use Solr 4.4)
>
> 2016-01-28 11:07 GMT+01:00 Damien Picard <pi...@gmail.com>:
>
>> Hi,
>>
>> We are using SolrCloud (4 nodes) and we have defined a suggester using
>> the spellcheck component.
>>
>> The suggester is defined as :
>>
>> <searchComponent class="solr.SpellCheckComponent" name="suggest">
>>       <lst name="spellchecker">
>>         <str name="name">suggestOpeGes</str>
>>         <str
>> name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str>
>>         <str
>> name="classname">org.apache.solr.spelling.suggest.Suggester</str>
>>         <str name="field">ref_opegestion</str>
>>         <float name="threshold">0</float>
>>         <str name="buildOnCommit">true</str>
>>         <str name="buildOnOptimize">true</str>
>>       </lst>
>>       <lst name="spellchecker">
>>         <str name="name">suggestRefCre</str>
>>         <str
>> name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str>
>>         <str
>> name="classname">org.apache.solr.spelling.suggest.Suggester</str>
>>         <str name="field">ref_cre</str>
>>         <float name="threshold">0</float>
>>         <str name="buildOnCommit">true</str>
>>         <str name="buildOnOptimize">true</str>
>>       </lst>
>>       <lst name="spellchecker">
>>         <str name="name">suggestRefEcr</str>
>>         <str
>> name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str>
>>         <str
>> name="classname">org.apache.solr.spelling.suggest.Suggester</str>
>>         <str name="field">ref_ecriture</str>
>>         <float name="threshold">0</float>
>>         <str name="buildOnCommit">true</str>
>>         <str name="buildOnOptimize">true</str>
>>       </lst>
>>   </searchComponent>
>>   <requestHandler class="solr.SearchHandler" name="/suggest"
>> startup="lazy">
>>     <lst name="defaults">
>>         <str name="spellcheck">true</str>
>>         <str name="spellcheck.dictionary">suggestOpeGes</str>
>>         <str name="spellcheck.count">20</str>
>>         <str name="spellcheck.collate">true</str>
>>         <str name="spellcheck.onlyMorePopular">false</str>
>>     </lst>
>>     <arr name="components">
>>       <str>suggest</str>
>>     </arr>
>>   </requestHandler>
>>
>> When I query this collection suggest with the shards parameters :
>> GET
>> /solr/ppd_piste_audit_gsie_traite_001/suggest?q=GSIEBBA&wt=json&indent=true&spellcheck=true&spellcheck.dictionary=suggestOpeGes&shards.qt=suggest/
>>
>> I get no results :
>>
>> {
>>   "responseHeader":{
>>     "status":0,
>>     "QTime":0}}
>>
>> But, when I disable the distributed search :
>> GET
>> /solr/ppd_piste_audit_gsie_traite_001/suggest?q=GSIEMMA&wt=json&indent=true&spellcheck=true&spellcheck.dictionary=suggestOpeGes&distrib=false
>>
>> I get the results I expect :
>>
>> {
>>   "responseHeader":{
>>     "status":0,
>>     "QTime":28},
>>   "spellcheck":{
>>     "suggestions":[
>>       "GSIEBBA",{
>>         "numFound":20,
>>         "startOffset":0,
>>         "endOffset":7,
>>         "suggestion":["GSIEMMA44257700010010401",
>>           "GSIEBBA64257700010013501",
>>           "GSIEBBA70723503779040201",
>>           "GSIEBBA71257700030012101",
>>           "GSIEBBA71723503830023601",
>>           "GSIEBBA74001300670011701",
>>           "GSIEBBA74001300670011801",
>>           "GSIEBBA74772000136021201",
>>           "GSIEBBA76257700040010501",
>>           "GSIEBBA76600101133030501",
>>           "GSIEBBA76680400195030601",
>>           "GSIEBBA77692100093024401",
>>           "GSIEBBA77692100093024501",
>>           "GSIEBBA78450700227020701",
>>           "GSIEBBA78450700227020801",
>>           "GSIEBBA78854102439020301",
>>           "GSIEBBA78854102439020401",
>>           "GSIEBBA79441700201040401",
>>           "GSIEBBA79723504720012701",
>>           "GSIEBBA79763600779010501"]},
>>       "collation","GSIEBBA44257700010010401"]}}
>>
>> I also try to send a "manually" distributed search without success :
>>
>> GET
>> /solr/ppd_piste_audit_gsie_traite_001-000003_shard1_replica2/suggest?q=GSIEMMA&qt=suggest&wt=json&indent=true&spellcheck=true&spellcheck.dictionary=suggestOpeGes&shards.qt=suggest/&shards=dn330003.xxx.priv:8983/solr/ppd_piste_audit_gsie_traite_001-000003_shard2_replica1/|dn330004.xxx.priv:8983/solr/ppd_piste_audit_gsie_traite_001-000003_shard1_replica1/
>>
>> What am I doing wrong ?
>>
>> Thank you.
>> --
>> Damien Picard
>> Expert GWT
>> <http://www.editions-eni.fr/livres/gwt-google-web-toolkit-developpez-des-applications-internet-riches-ria-en-java/.97a1a26e7d5be94763fc45ac2a1e961a.html>
>> Mob : 06 11 51 47 78
>>
>
>
>
> --
> Damien Picard
> Expert GWT
> <http://www.editions-eni.fr/livres/gwt-google-web-toolkit-developpez-des-applications-internet-riches-ria-en-java/.97a1a26e7d5be94763fc45ac2a1e961a.html>
> Mob : 06 11 51 47 78
>



-- 
Damien Picard
Expert GWT
<http://www.editions-eni.fr/livres/gwt-google-web-toolkit-developpez-des-applications-internet-riches-ria-en-java/.97a1a26e7d5be94763fc45ac2a1e961a.html>
Mob : 06 11 51 47 78

Re: Unable to query the spellchecker in a distributed way

Posted by Damien Picard <pi...@gmail.com>.
(we use Solr 4.4)

2016-01-28 11:07 GMT+01:00 Damien Picard <pi...@gmail.com>:

> Hi,
>
> We are using SolrCloud (4 nodes) and we have defined a suggester using the
> spellcheck component.
>
> The suggester is defined as :
>
> <searchComponent class="solr.SpellCheckComponent" name="suggest">
>       <lst name="spellchecker">
>         <str name="name">suggestOpeGes</str>
>         <str
> name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str>
>         <str
> name="classname">org.apache.solr.spelling.suggest.Suggester</str>
>         <str name="field">ref_opegestion</str>
>         <float name="threshold">0</float>
>         <str name="buildOnCommit">true</str>
>         <str name="buildOnOptimize">true</str>
>       </lst>
>       <lst name="spellchecker">
>         <str name="name">suggestRefCre</str>
>         <str
> name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str>
>         <str
> name="classname">org.apache.solr.spelling.suggest.Suggester</str>
>         <str name="field">ref_cre</str>
>         <float name="threshold">0</float>
>         <str name="buildOnCommit">true</str>
>         <str name="buildOnOptimize">true</str>
>       </lst>
>       <lst name="spellchecker">
>         <str name="name">suggestRefEcr</str>
>         <str
> name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str>
>         <str
> name="classname">org.apache.solr.spelling.suggest.Suggester</str>
>         <str name="field">ref_ecriture</str>
>         <float name="threshold">0</float>
>         <str name="buildOnCommit">true</str>
>         <str name="buildOnOptimize">true</str>
>       </lst>
>   </searchComponent>
>   <requestHandler class="solr.SearchHandler" name="/suggest"
> startup="lazy">
>     <lst name="defaults">
>         <str name="spellcheck">true</str>
>         <str name="spellcheck.dictionary">suggestOpeGes</str>
>         <str name="spellcheck.count">20</str>
>         <str name="spellcheck.collate">true</str>
>         <str name="spellcheck.onlyMorePopular">false</str>
>     </lst>
>     <arr name="components">
>       <str>suggest</str>
>     </arr>
>   </requestHandler>
>
> When I query this collection suggest with the shards parameters :
> GET
> /solr/ppd_piste_audit_gsie_traite_001/suggest?q=GSIEBBA&wt=json&indent=true&spellcheck=true&spellcheck.dictionary=suggestOpeGes&shards.qt=suggest/
>
> I get no results :
>
> {
>   "responseHeader":{
>     "status":0,
>     "QTime":0}}
>
> But, when I disable the distributed search :
> GET
> /solr/ppd_piste_audit_gsie_traite_001/suggest?q=GSIEMMA&wt=json&indent=true&spellcheck=true&spellcheck.dictionary=suggestOpeGes&distrib=false
>
> I get the results I expect :
>
> {
>   "responseHeader":{
>     "status":0,
>     "QTime":28},
>   "spellcheck":{
>     "suggestions":[
>       "GSIEBBA",{
>         "numFound":20,
>         "startOffset":0,
>         "endOffset":7,
>         "suggestion":["GSIEMMA44257700010010401",
>           "GSIEBBA64257700010013501",
>           "GSIEBBA70723503779040201",
>           "GSIEBBA71257700030012101",
>           "GSIEBBA71723503830023601",
>           "GSIEBBA74001300670011701",
>           "GSIEBBA74001300670011801",
>           "GSIEBBA74772000136021201",
>           "GSIEBBA76257700040010501",
>           "GSIEBBA76600101133030501",
>           "GSIEBBA76680400195030601",
>           "GSIEBBA77692100093024401",
>           "GSIEBBA77692100093024501",
>           "GSIEBBA78450700227020701",
>           "GSIEBBA78450700227020801",
>           "GSIEBBA78854102439020301",
>           "GSIEBBA78854102439020401",
>           "GSIEBBA79441700201040401",
>           "GSIEBBA79723504720012701",
>           "GSIEBBA79763600779010501"]},
>       "collation","GSIEBBA44257700010010401"]}}
>
> I also try to send a "manually" distributed search without success :
>
> GET
> /solr/ppd_piste_audit_gsie_traite_001-000003_shard1_replica2/suggest?q=GSIEMMA&qt=suggest&wt=json&indent=true&spellcheck=true&spellcheck.dictionary=suggestOpeGes&shards.qt=suggest/&shards=dn330003.xxx.priv:8983/solr/ppd_piste_audit_gsie_traite_001-000003_shard2_replica1/|dn330004.xxx.priv:8983/solr/ppd_piste_audit_gsie_traite_001-000003_shard1_replica1/
>
> What am I doing wrong ?
>
> Thank you.
> --
> Damien Picard
> Expert GWT
> <http://www.editions-eni.fr/livres/gwt-google-web-toolkit-developpez-des-applications-internet-riches-ria-en-java/.97a1a26e7d5be94763fc45ac2a1e961a.html>
> Mob : 06 11 51 47 78
>



-- 
Damien Picard
Expert GWT
<http://www.editions-eni.fr/livres/gwt-google-web-toolkit-developpez-des-applications-internet-riches-ria-en-java/.97a1a26e7d5be94763fc45ac2a1e961a.html>
Mob : 06 11 51 47 78