[ 
https://issues.apache.org/jira/browse/SOLR-4414?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13573815#comment-13573815
 ] 

Shawn Heisey commented on SOLR-4414:
------------------------------------

I hope it's user error, not a bug.  Here's how I've configured my request 
handler.  The first one is the broker core, the second one is the config on the 
shard cores.  I have also tried this with the MoreLikeThisComponent in a 
regular search handler.

{code}
<requestHandler name="/mlt" class="solr.MoreLikeThisHandler">
  <lst name="defaults">
    <str name="mlt">true</str>
    <str name="mlt.fl">catchall</str>
    <str name="mlt.boost">true</str>
    <str 
name="shards">bigindy5.REDACTED.com:8982/solr/inclive,bigindy5.REDACTED.com:8982/solr/s0live,bigindy5.REDACTED.com:8982/solr/s1live,bigindy5.REDACTED.com:8982/solr/s2live,bigindy5.REDACTED.com:8982/solr/s3live,bigindy5.REDACTED.com:8982/solr/s4live,bigindy5.REDACTED.com:8982/solr/s5live</str>
    <str name="shards.qt">/mlt</str>
    <str name="echoParams">all</str>
  </lst>
</requestHandler>

<requestHandler name="/mlt" class="solr.MoreLikeThisHandler">
  <lst name="defaults">
    <str name="mlt">true</str>
    <str name="mlt.fl">catchall</str>
    <str name="mlt.boost">true</str>
    <str name="mlt.count">100</str>
    <str name="echoParams">all</str>
  </lst>
</requestHandler>
{code}

When I send a query to /mlt on the broker core, I get the following.  The same 
query to /select returns one document.

{code}
<?xml version="1.0" encoding="UTF-8"?>
<response>

<lst name="responseHeader">
  <int name="status">0</int>
  <int name="QTime">0</int>
  <lst name="params">
    <str name="echoParams">all</str>
    <str 
name="shards">bigindy5.REDACTED.com:8982/solr/inclive,bigindy5.REDACTED.com:8982/solr/s0live,bigindy5.REDACTED.com:8982/solr/s1live,bigindy5.REDACTED.com:8982/solr/s2live,bigindy5.REDACTED.com:8982/solr/s3live,bigindy5.REDACTED.com:8982/solr/s4live,bigindy5.REDACTED.com:8982/solr/s5live</str>
    <str name="mlt.boost">true</str>
    <str name="mlt.fl">catchall</str>
    <str name="shards.qt">/mlt</str>
    <str name="mlt">true</str>
    <str name="indent">true</str>
    <str name="q">tag_id:efespphotos531595</str>
    <str name="wt">xml</str>
  </lst>
</lst>
<result name="match" numFound="0" start="0">
</result>
<null name="response"/>
</response>
{code}

Note that if I send the exact same request to the core that contains the 
document, I get results.  This just involves changing the part of the URL after 
/solr, no other changes.  Here's the first part of the response.  I've left the 
actual results out.

{code}
<?xml version="1.0" encoding="UTF-8"?>
<response>

<lst name="responseHeader">
  <int name="status">0</int>
  <int name="QTime">198</int>
  <lst name="params">
    <str name="echoParams">all</str>
    <str name="mlt.count">100</str>
    <str name="mlt.boost">true</str>
    <str name="mlt.fl">catchall</str>
    <str name="mlt">true</str>
    <str name="indent">true</str>
    <str name="q">tag_id:efespphotos531595</str>
    <str name="wt">xml</str>
  </lst>
</lst>
<result name="match" numFound="1" start="0">
  <doc>
...
{code}

                
> MoreLikeThis on a shard finds no interesting terms if the document queried is 
> not in that shard
> -----------------------------------------------------------------------------------------------
>
>                 Key: SOLR-4414
>                 URL: https://issues.apache.org/jira/browse/SOLR-4414
>             Project: Solr
>          Issue Type: Bug
>          Components: MoreLikeThis, SolrCloud
>    Affects Versions: 4.1
>            Reporter: Colin Bartolome
>
> Running a MoreLikeThis query in a cloud works only when the document being 
> queried exists in whatever shard serves the request. If the document is not 
> present in the shard, no "interesting terms" are found and, consequently, no 
> matches are found.
> h5. Steps to reproduce
> * Edit example/solr/collection1/conf/solrconfig.xml and add this line, with 
> the rest of the request handlers:
> {code:xml}
> <requestHandler name="/mlt" class="solr.MoreLikeThisHandler" />
> {code}
> * Follow the [simplest SolrCloud 
> example|http://wiki.apache.org/solr/SolrCloud#Example_A:_Simple_two_shard_cluster]
>  to get two shards running.
> * Hit this URL: 
> [http://localhost:8983/solr/collection1/mlt?mlt.fl=includes&q=id:3007WFP&mlt.match.include=false&mlt.interestingTerms=list&mlt.mindf=1&mlt.mintf=1]
> * Compare that output to that of this URL: 
> [http://localhost:7574/solr/collection1/mlt?mlt.fl=includes&q=id:3007WFP&mlt.match.include=false&mlt.interestingTerms=list&mlt.mindf=1&mlt.mintf=1]
> The former URL will return a result and list some interesting terms. The 
> latter URL will return no results and list no interesting terms. It will also 
> show this odd XML element:
> {code:xml}
> <null name="response"/>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to