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

CloudMLTQParser does not use uniqueKey field name for exclusion

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 5.5.1, 6.0
    • None
    • None

    Description

      Using the {!mlt} query parser in cloud mode on a schema with a non-"id" uniqueKey, the main "like this" document won't be excluded properly due to this code:

      realMLTQuery.add(createIdQuery("id", id), BooleanClause.Occur.MUST_NOT);
      

      See also https://github.com/apache/lucene-solr/blob/813ca77250db29116812bc949e2a466a70f969a3/solr/core/src/java/org/apache/solr/search/mlt/CloudMLTQParser.java#L166

      Like SimpleMLTQParser, it needs to use the uniqueKey field with this type of code: req.getSchema().getUniqueKeyField().getName()

      Attachments

        Activity

          People

            Unassigned Unassigned
            ehatcher Erik Hatcher
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: