Lucene - Core
  1. Lucene - Core
  2. LUCENE-1093

SpanFirstQuery modification to aid term boosting based on position.

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core/query/scoring
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      This is a request for a modification to SpanFirstQuery that would allow term boosting based on a term's distance from the beginning of the document.

      This modification to SpanFirstQuery would be that the Spans returned by SpanFirstQuery.getSpans() must always return 0 from its start() method. Then the slop passed to sloppyFreq(slop) would be the distance from the beginning of the indexed field to the end of the Spans of the SpanQuery passed to SpanFirstQuery.

      Here is the discussion behind this issue:
      http://www.nabble.com/Can-I-do-boosting-based-on-term-postions--to11939423.html#a11939423

      1. TestBasics20071227.patch
        3 kB
        Peter Keegan
      2. SpanFirst20071219.patch
        4 kB
        Paul Elschot

        Activity

        Hide
        Jan Høydahl added a comment -

        This issue has been inactive for more than 4 years. Please close if it's no longer relevant/needed, or bring it up to date if you intend to work on it. SPRING_CLEANING_2013

        Show
        Jan Høydahl added a comment - This issue has been inactive for more than 4 years. Please close if it's no longer relevant/needed, or bring it up to date if you intend to work on it. SPRING_CLEANING_2013
        Hide
        Paul Elschot added a comment -

        With both patches applied, SpanFirstQuery and test in TestBasics, all tests pass nicely here.

        Show
        Paul Elschot added a comment - With both patches applied, SpanFirstQuery and test in TestBasics, all tests pass nicely here.
        Hide
        Peter Keegan added a comment -

        Here is a patch to 'TestBasics' that adds a test case for 'passSpansFirst = false'

        Show
        Peter Keegan added a comment - Here is a patch to 'TestBasics' that adds a test case for 'passSpansFirst = false'
        Hide
        Paul Elschot added a comment -

        This 20071219 patch adds a private flag and a constructor for this flag to SpanFirstQuery. The flag indicates whether the start of the resulting Spans should be zero or default to the start of the given spans.

        ant -Dtestcase='Test*Span*' test-core
        passes independent of whether or not this flag is set by default, so some more tests are needed.

        Show
        Paul Elschot added a comment - This 20071219 patch adds a private flag and a constructor for this flag to SpanFirstQuery. The flag indicates whether the start of the resulting Spans should be zero or default to the start of the given spans. ant -Dtestcase='Test*Span*' test-core passes independent of whether or not this flag is set by default, so some more tests are needed.
        Hide
        Grant Ingersoll added a comment -

        Another option would be to introduce something like SpanFrontWeightedQuery or something like that and leave SFQ alone.

        Show
        Grant Ingersoll added a comment - Another option would be to introduce something like SpanFrontWeightedQuery or something like that and leave SFQ alone.
        Hide
        Hoss Man added a comment -

        NOTE: this should be an option, not a change to the default behavior (right now a SpanFirstQuery always returns Spans the same size as it's subquery ... changing this could radically affect the scores users get from existing queries.

        API that seems like it would make the most sense is a new boolean getter/setter that defaults to false ... no idea what agood descriptive name for it would be.

        (I too thought we added this a long time ago, i remember asking about it when i was writing unit tests for SpanQuery.explain)

        Show
        Hoss Man added a comment - NOTE: this should be an option, not a change to the default behavior (right now a SpanFirstQuery always returns Spans the same size as it's subquery ... changing this could radically affect the scores users get from existing queries. API that seems like it would make the most sense is a new boolean getter/setter that defaults to false ... no idea what agood descriptive name for it would be. (I too thought we added this a long time ago, i remember asking about it when i was writing unit tests for SpanQuery.explain)

          People

          • Assignee:
            Unassigned
            Reporter:
            Peter Keegan
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development