1

My More Like This query doesn't return the results for any start value other than 0.

My Query URLs with Responses are below:

http://IP_ADDRESS:8983/solr/CORE_NAME/select?indent=on&q=one:ABC&mlt=true&mlt.fl=one,two,three&&rows=100&start=0&wt=json

The above works Fine.

http://IP_ADDRESS:8983/solr/CORE_NAME/select?indent=on&q=one:ABC&mlt=true&mlt.fl=one,two,three&&rows=100&start=1&wt=json

The above query throws the below result:

{
  "responseHeader":{
    "status":0,
    "QTime":1,
    "params":{
      "q":"one:ABC",
      "mlt":"true",
      "indent":"on",
      "mlt.fl":"one, two, three",
      "start":"1",
      "rows":"100",
      "wt":"json"}},
  "response":{"numFound":1,"start":1,"docs":[]
  },
  "moreLikeThis":{}}

I'm using solr 6.3 and the Schema for MLT that i used is below:

    <requestHandler name="mlt_tracks" class="solr.MoreLikeThisHandler">

    <lst name="defaults">

    <str name="mlt.fl">one, two, three </str>

    <str name="mlt.mintf">2</str>

    <str name="rows">10</str>

    <str name="mlt.mindf">2</str>

    <str name="mlt.boost">true</str>

    </lst>

    </requestHandler>
Kabhi
  • 135
  • 1
  • 12

1 Answers1

1

Define mlt defaults in your /select handler.

<str name="mlt.fl">one, two, three </str>

    <str name="mlt.mintf">2</str>

    <str name="rows">10</str>

    <str name="mlt.mindf">2</str>

    <str name="mlt.boost">true</str>

Copy above into /select handler definition, paste in defaults section.

<lst name="defaults"> paste here </lst> 

OR

update request handler name with / like name="/mlt_tracks"

<requestHandler name="/mlt_tracks" class="solr.MoreLikeThisHandler">

And use /mlt_tracks instead of /select to query

http://IP_ADDRESS:8983/solr/CORE_NAME/mlt_tracks?indent=on&q=one:ABC&mlt=true&mlt.fl=one,two,three&&rows=100&start=1&wt=json
Vinod
  • 1,965
  • 1
  • 9
  • 18
  • 1
    Restart solr after modification as above in solrconfig.xml file. – Vinod Jan 11 '17 at 07:38
  • 2
    Could you also add an explanation of why this changes how `start` is interpreted? (you're now [actually working with the result from "More like this"](https://wiki.apache.org/solr/MoreLikeThis), instead of the original result set) – MatsLindh Jan 11 '17 at 10:01
  • `start` tells from where it should begin to return documents in result. it starts from 0. if start=1, it skips first document. – Vinod Jan 11 '17 at 11:03