Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-7143

MoreLikeThis Query Parser does not handle multiple field names

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.0
    • 5.3
    • query parsers
    • None

    Description

      The newly introduced MoreLikeThis Query Parser (SOLR-6248) does not return any results when supplied with multiple fields in the qf parameter.

      To reproduce within the techproducts example, compare:

      curl 'http://localhost:8983/solr/techproducts/select?q=%7B!mlt+qf=name%7DMA147LL/A'
      curl 'http://localhost:8983/solr/techproducts/select?q=%7B!mlt+qf=features%7DMA147LL/A'
      curl 'http://localhost:8983/solr/techproducts/select?q=%7B!mlt+qf=name,features%7DMA147LL/A'
      

      The first two queries return 8 and 5 results, respectively. The third query doesn't return any results (not even the matched document).

      In contrast, the MoreLikeThis Handler works as expected (accounting for the default mintf and mindf values in SimpleMLTQParser):

      curl 'http://localhost:8983/solr/techproducts/mlt?q=id:MA147LL/A&mlt.fl=name&mlt.mintf=1&mlt.mindf=1'
      curl 'http://localhost:8983/solr/techproducts/mlt?q=id:MA147LL/A&mlt.fl=features&mlt.mintf=1&mlt.mindf=1'
      curl 'http://localhost:8983/solr/techproducts/mlt?q=id:MA147LL/A&mlt.fl=name,features&mlt.mintf=1&mlt.mindf=1'
      

      After adding the following line to example/techproducts/solr/techproducts/conf/solrconfig.xml:

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

      The first two queries return 7 and 4 results, respectively (excluding the matched document). The third query returns 7 results, as one would expect.

      Attachments

        1. SOLR-7143.patch
          17 kB
          Anshum Gupta
        2. SOLR-7143.patch
          11 kB
          Anshum Gupta
        3. SOLR-7143.patch
          5 kB
          Jens Wille
        4. SOLR-7143.patch
          10 kB
          Vitaliy Zhovtyuk
        5. SOLR-7143.patch
          5 kB
          Vitaliy Zhovtyuk

        Issue Links

          Activity

            People

              anshum Anshum Gupta
              blackwinter Jens Wille
              Votes:
              1 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: