Solr
  1. Solr
  2. SOLR-5042

MoreLikeThis doesn't return a score when mlt.count is set to 10

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 4.3
    • Fix Version/s: 4.6
    • Component/s: MoreLikeThis
    • Labels:
      None

      Description

      The problem appears to be around the mlt.count with in the solrconfig.xml. When this value is set to 10, the 10 values that have been identified as 'most like this' are returned with the original query, however the 'score' field is missing.

      Changing the mlt.count to say 11 and issuing the same query then the 'score' field is returned with the same query. This appears to be the workaround. 11 was just an arbitrary value, 12 or 15 also work

      The same problem was raised on stackoverflow http://stackoverflow.com/questions/16513719/solr-more-like-this-dont-return-score-while-specify-mlt-count

      1. SOLR-5042.patch
        2 kB
        Anshum Gupta
      2. SOLR-5042.4.2.1.patch
        5 kB
        Bill Mitchell

        Issue Links

          Activity

          Hide
          Hoss Man added a comment -

          this was fixed in 4.6 but never resolved

          Show
          Hoss Man added a comment - this was fixed in 4.6 but never resolved
          Hide
          Bill Mitchell added a comment -

          Although the source fix to this has been included in solr 4.6, I needed it fixed in the earlier 4.2.1, so I've relocated the patch back to the earlier version. A simple verification of the fix has been included in the test case included in SOLR-1085.

          Show
          Bill Mitchell added a comment - Although the source fix to this has been included in solr 4.6, I needed it fixed in the earlier 4.2.1, so I've relocated the patch back to the earlier version. A simple verification of the fix has been included in the test case included in SOLR-1085 .
          Hide
          Markus Jelsma added a comment -

          Great work! Thanks!

          Show
          Markus Jelsma added a comment - Great work! Thanks!
          Hide
          Anshum Gupta added a comment -

          Markus Jelsma yes this issue was resolved but I just didn't get time to add unit tests for it yet.
          I'd however manually tested this.

          Show
          Anshum Gupta added a comment - Markus Jelsma yes this issue was resolved but I just didn't get time to add unit tests for it yet. I'd however manually tested this.
          Hide
          Markus Jelsma added a comment -

          Guys, i see some commits in trunk and 4x, is this issue resolved?
          Thanks

          Show
          Markus Jelsma added a comment - Guys, i see some commits in trunk and 4x, is this issue resolved? Thanks
          Hide
          ASF subversion and git services added a comment -

          Commit 1534005 from Shawn Heisey in branch 'dev/branches/branch_4x'
          [ https://svn.apache.org/r1534005 ]

          SOLR-5042 SOLR-5125 SOLR-5368: mlt.count used incorrectly in MoreLikeThisComponent. (merge trunk r1533995)

          Show
          ASF subversion and git services added a comment - Commit 1534005 from Shawn Heisey in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1534005 ] SOLR-5042 SOLR-5125 SOLR-5368 : mlt.count used incorrectly in MoreLikeThisComponent. (merge trunk r1533995)
          Hide
          ASF subversion and git services added a comment -

          Commit 1533995 from Shawn Heisey in branch 'dev/trunk'
          [ https://svn.apache.org/r1533995 ]

          SOLR-5042 SOLR-5125 SOLR-5368: mlt.count used incorrectly in MoreLikeThisComponent.

          Show
          ASF subversion and git services added a comment - Commit 1533995 from Shawn Heisey in branch 'dev/trunk' [ https://svn.apache.org/r1533995 ] SOLR-5042 SOLR-5125 SOLR-5368 : mlt.count used incorrectly in MoreLikeThisComponent.
          Hide
          Shawn Heisey added a comment -

          Anshum pinged on this issue via IRC. Patch passes tests and precommit on trunk, committing. I am not familiar enough with these internals to write a test for this issue, so I'll leave the issue open for a little while.

          Show
          Shawn Heisey added a comment - Anshum pinged on this issue via IRC. Patch passes tests and precommit on trunk, committing. I am not familiar enough with these internals to write a test for this issue, so I'll leave the issue open for a little while.
          Hide
          Anshum Gupta added a comment -

          This fixes both EarlyTerminatingCollectorException and the score issue.

          Show
          Anshum Gupta added a comment - This fixes both EarlyTerminatingCollectorException and the score issue.
          Hide
          Anshum Gupta added a comment -

          The mlt.count was being treated as the value for flags, tripping the EarlyTerminatingCollectorException depending on the value of mlt.count.

          Show
          Anshum Gupta added a comment - The mlt.count was being treated as the value for flags, tripping the EarlyTerminatingCollectorException depending on the value of mlt.count.
          Hide
          Anshum Gupta added a comment -

          Markus Jelsma sure but I see a patch that Mark Miller put up already.
          Will try and have a look at it anyways.

          Show
          Anshum Gupta added a comment - Markus Jelsma sure but I see a patch that Mark Miller put up already. Will try and have a look at it anyways.
          Hide
          Markus Jelsma added a comment - - edited

          Anshum, can you also check SOLR-5125?

          Show
          Markus Jelsma added a comment - - edited Anshum, can you also check SOLR-5125 ?
          Hide
          Anshum Gupta added a comment -

          The issue here seems to be due to the apparent misuse of count in the MoreLikeThis component.

          MoreLikeThisComponent.java
          int mltcount = params.getInt(MoreLikeThisParams.DOC_COUNT, 5);
          
          MoreLikeThisComponent.java L113
          NamedList<DocList> sim = getMoreLikeThese(rb, rb.req.getSearcher(), rb.getResults().docList,
                      mltcount);
          

          The signature for getMoreLikeThese however is:

          MoreLikeThisComponent.java L339
          NamedList<DocList> getMoreLikeThese(ResponseBuilder rb,
                SolrIndexSearcher searcher, DocList docs, int flags) throws IOException {
          

          I'll try and put up a patch.

          Show
          Anshum Gupta added a comment - The issue here seems to be due to the apparent misuse of count in the MoreLikeThis component. MoreLikeThisComponent.java int mltcount = params.getInt(MoreLikeThisParams.DOC_COUNT, 5); MoreLikeThisComponent.java L113 NamedList<DocList> sim = getMoreLikeThese(rb, rb.req.getSearcher(), rb.getResults().docList, mltcount); The signature for getMoreLikeThese however is: MoreLikeThisComponent.java L339 NamedList<DocList> getMoreLikeThese(ResponseBuilder rb, SolrIndexSearcher searcher, DocList docs, int flags) throws IOException { I'll try and put up a patch.

            People

            • Assignee:
              Shawn Heisey
              Reporter:
              Josh Curran
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development