Lucene - Core
  1. Lucene - Core
  2. LUCENE-3299

refactoring of Similarity.sloppyFreq() and Similarity.scorePayload

    Details

    • Type: Task Task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0-ALPHA
    • Component/s: core/query/scoring
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      Currently these are top-level, but they only affect the SloppyDocScorer.
      So it makes more sense to put these into the SloppyDocScorer api, this gives you additional flexibility
      (e.g. combining payloads with CSF or whatever the hell you want to do), and is cleaner.

      Furthermore, there are the following confusing existing issues:

      • scorePayload should take bytesref
      • PayloadTermScorer passes a null byte[] array to the sim if there are no payloads. I don't think it should do this, and its inconsistent with PayloadNearQuery, which does not do this. Its an undocumented conditional you need to have in the scoring algorithm which we should remove.
      • there is an unused constant for scorepayload (NO_DOC_ID_PROVIDED), which is a documented, but never used anywhere. I think we should remove this conditional too, because its not possible to have a payload without a docid, and we shouldn't be passing fake document ids (-1) to our scoring APIs anyway.

        Activity

        Hide
        Robert Muir added a comment -

        also one more issue corrected here, previously Similarity had a default implementation "return 1" for scorePayload.

        I moved this default implementation into DefaultSimilarity where it belongs.

        Show
        Robert Muir added a comment - also one more issue corrected here, previously Similarity had a default implementation "return 1" for scorePayload. I moved this default implementation into DefaultSimilarity where it belongs.

          People

          • Assignee:
            Unassigned
            Reporter:
            Robert Muir
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development