Hi,

Recently, while implementing the MoreLikeThis search, I've run into the
situation when Solr's mlt query calls don't work. 

More specifically, the following query:

http://localhost:8080/solr/select?q=id:10&mlt=true&mlt.fl=content_mlt&mlt.maxqt=
5&mlt.interestingTerms=details&fl=title+author+score

brings back just the doc with id=10 and nothing else. While using the
GetMethod approach (putting /mlt explicitely into the url), I got back some
results.

I've been trying to solve this problem for more than a week with no luck. If
anybody has any hint, please help.

Below, I put logs & outputs from 3 runs: a) Solr; b) GetMethod (/mlt); c)
GetMethod (/select).

Thanks a lot.

Regards,
Sergey Goldberg


Here're the logs: 

a) Solr (http://localhost:8080/solr/select)
08.07.2009 15:50:33 org.apache.solr.core.SolrCore execute
INFO: [] webapp=/solr path=/select
params={fl=title+author+score&mlt.fl=content_mlt&q=id:10&mlt=
true&mlt.interestingTerms=details&mlt.maxqt=5&wt=javabin&version=2.2} hits=1
status=0 QTime=172

INFO MLTSearchRequestProcessor:49 - SolrServer url:
http://localhost:8080/solr
INFO MLTSearchRequestProcessor:67 - solrQuery>
q=id%3A10&mlt=true&mlt.fl=content_mlt&mlt.maxqt=
        5&mlt.interestingTerms=details&fl=title+author+score
INFO MLTSearchRequestProcessor:73 - Number of docs found = 1
INFO MLTSearchRequestProcessor:77 - title = SG_Book; score = 2.098612


b) GetMethod (http://localhost:8080/solr/mlt)
08.07.2009 16:55:44 org.apache.solr.core.SolrCore execute
INFO: [] webapp=/solr path=/mlt
params={fl=title+author+score&mlt.fl=content_mlt&q=id:10&mlt.max
qt=5&mlt.interestingTerms=details} status=0 QTime=15

INFO MLT2SearchRequestProcessor:76 - <?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">0</int><int
name="QTime">0</int></lst><result name="match" numFound="1" start="0"
maxScore="2.098612"><doc><float name="score">2.098612</float><arr name="
author"><str>S.G.</str></arr><str
name="title">SG_Book</str></doc></result><result name="response" n
umFound="4" start="0" maxScore="0.28923997"><doc><float
name="score">0.28923997</float><arr name="author"><str>O.
Henry</str><str>S.G.</str></arr><str name="title">Four Million,
The</str></doc><doc><float name="score">0.08667877</float><arr
name="author"><str>Katherine Mosby</str></arr><str name="title">The Season
of Lillian Dawes</str></doc><doc><float name="score">0.07947738</float><arr
name="author"><str>Jerome K. Jerome</str></arr><str name="title">Three Men
in a Boat</str></doc><doc><float 
name="score">0.047219563</float><arr name="author"><str>Charles
Oliver</str><str>S.G.</str></arr><str name="title">ABC's of
Science</str></doc></result><lst name="interestingTerms"><float
name="content_mlt:ye">1.0</float><float
name="content_mlt:tobin">1.0</float><float
name="content_mlt:a">1.0</float><float
name="content_mlt:i">1.0</float><float
name="content_mlt:his">1.0</float></lst>
</response>


c) GetMethod (http://localhost:8080/solr/select)
08.07.2009 17:06:45 org.apache.solr.core.SolrCore execute
INFO: [] webapp=/solr path=/select
params={fl=title+author+score&mlt.fl=content_mlt&q=id:10&mlt.
maxqt=5&mlt.interestingTerms=details} hits=1 status=0 QTime=16

INFO MLT2SearchRequestProcessor:80 - <?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">0</int><int
name="QTime">16</int><lst name="params"><str name="fl">title author
score</str><str name="mlt.fl">content_mlt</str><str name="q">id:10</str><str
name="mlt.maxqt">5</str><str
name="mlt.interestingTerms">details</str></lst></lst><result name="response"
numFound="1" start="0" maxScore="2.098612"><doc><float
name="score">2.098612</float><arr name="author"><str>S.G.</str></arr><str
name="title">SG_Book</str></doc></result><lst name="debug"><str
name="rawquerystring">id:10</str><str name="querystring">id:10</str><str
name="parsedq
uery">id:10</str><str name="parsedquery_toString">id:10</str><lst
name="explain"><str name="10">
2.098612 = (MATCH) weight(id:10 in 3), product of:
  0.99999994 = queryWeight(id:10), product of:
    2.0986123 = idf(docFreq=1, numDocs=5)
    0.47650534 = queryNorm
  2.0986123 = (MATCH) fieldWeight(id:10 in 3), product of:
    1.0 = tf(termFreq(id:10)=1)
    2.0986123 = idf(docFreq=1, numDocs=5)
    1.0 = fieldNorm(field=id, doc=3)
</str></lst><str name="QParser">OldLuceneQParser</str><lst
name="timing"><double name="time">16.0</double><lst name="prepare"><double
name="time">0.0</double><lst
name="org.apache.solr.handler.component.QueryComponent"><double
name="time">0.0</double></lst><lst
name="org.apache.solr.handler.component.FacetComponent"><double
name="time">0.0</double></lst><lst name="org.apache.solr.handler.component
.MoreLikeThisComponent"><double name="time">0.0</double></lst><lst
name="org.apache.solr.handler.component.HighlightComponent"><double
name="time">0.0</double></lst><lst
name="org.apache.solr.handler.component.DebugComponent"><double
name="time">0.0</double></lst></lst><lst name="process"><double
name="time">16.0</double><lst
name="org.apache.solr.handler.component.QueryComponent"><double
name="time">0.0</double></lst><lst
name="org.apache.solr.handler.component.FacetComponent"><double
name="time">0.0</double></lst><lst
name="org.apache.solr.handler.component.MoreLikeThisComponent"><double
name="time">0.0</double></lst><lst
name="org.apache.solr.handler.component.HighlightComponent"><double 
name="time">0.0</double></lst><lst
name="org.apache.solr.handler.component.DebugComponent"><double
name="time">16.0</double></lst></lst></lst></lst>
</response>


And here're the relevant entries from solrconfig.xml:

 <requestHandler name="standard" class="solr.SearchHandler" default="true">
   <!-- default values for query parameters -->
    <lst name="defaults">
      <str name="echoParams">explicit</str>
      <str name="fl">id,title,author,score</str>
      <str name="debugQuery">on</str>
    </lst>
 </requestHandler>

 <requestHandler name="/mlt" class="solr.MoreLikeThisHandler">
    <lst name="defaults">
      <int name="mlt.mindf">1</int>
      <int name="mlt.maxqt">10</int>
    </lst>
 </requestHandler>
-- 
View this message in context: 
http://www.nabble.com/Solr%27s-MLT-query-call-doesn%27t-work-tp24391843p24391843.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to