Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.1
    • Fix Version/s: 2.9
    • Component/s: core/query/scoring
    • Labels:
      None

      Description

      This patch implements term boosting for SpanNearQuery. Refer to: http://www.gossamer-threads.com/lists/lucene/java-user/62779

      This patch works but probably needs more work. I don't like the use of 'instanceof', but I didn't want to touch Spans or TermSpans. Also, the payload code is mostly a copy of what's in BoostingTermQuery and could be common-sourced somewhere. Feel free to throw darts at it

      1. bnq.patch
        2 kB
        Peter Keegan
      2. bnq.patch
        2 kB
        Peter Keegan
      3. BoostingNearQuery.java
        4 kB
        Peter Keegan
      4. BoostingNearQuery.java
        4 kB
        Peter Keegan
      5. LUCENE-1341.patch
        18 kB
        Grant Ingersoll
      6. LUCENE-1341.patch
        9 kB
        Grant Ingersoll
      7. LUCENE-1341-new.patch
        9 kB
        Peter Keegan
      8. lucene-1341-new-1.patch
        17 kB
        Peter Keegan
      9. lucene-1341-new-2.patch
        18 kB
        Peter Keegan

        Issue Links

          Activity

          Hide
          Peter Keegan added a comment -

          Note that this patch requires java 1.5 or later (easily modified to run on 1.4)

          Show
          Peter Keegan added a comment - Note that this patch requires java 1.5 or later (easily modified to run on 1.4)
          Hide
          Peter Keegan added a comment -

          Here is version of patch for Java 1.4

          Show
          Peter Keegan added a comment - Here is version of patch for Java 1.4
          Hide
          Grant Ingersoll added a comment -

          Some minor updates. Makes the Near spans public and moves the BNQ to the payloads package.

          Peter, we need tests before this can be committed.

          Show
          Grant Ingersoll added a comment - Some minor updates. Makes the Near spans public and moves the BNQ to the payloads package. Peter, we need tests before this can be committed.
          Hide
          Peter Keegan added a comment -

          Here is an updated patch for the 2.4 branch.
          It's 6 months late because I missed Grant's e-mail requesting me to retest. I was just recently looking to see what became of the original patch.

          Peter

          Show
          Peter Keegan added a comment - Here is an updated patch for the 2.4 branch. It's 6 months late because I missed Grant's e-mail requesting me to retest. I was just recently looking to see what became of the original patch. Peter
          Hide
          Grant Ingersoll added a comment -

          Hi Peter,

          This looks good, I think it just needs some unit tests and then it will be good.

          Show
          Grant Ingersoll added a comment - Hi Peter, This looks good, I think it just needs some unit tests and then it will be good.
          Hide
          Peter Keegan added a comment -

          As I was debugging a unit test for BoostingNearQuery, I discovered that not all the payloads were getting read. The 'needToLoadPayload' flag on the termpos was getting reset on the last term in the span by NearSpansOrdered. Then I noticed that the term positions aren't even needed in BNQ because they were already collected by the Spans in 'matchPayload'. So, here is a newer, simpler implementation of BNQ along with some unit tests.

          Peter

          Show
          Peter Keegan added a comment - As I was debugging a unit test for BoostingNearQuery, I discovered that not all the payloads were getting read. The 'needToLoadPayload' flag on the termpos was getting reset on the last term in the span by NearSpansOrdered. Then I noticed that the term positions aren't even needed in BNQ because they were already collected by the Spans in 'matchPayload'. So, here is a newer, simpler implementation of BNQ along with some unit tests. Peter
          Hide
          Grant Ingersoll added a comment -

          Peter, can you bring this up to date? I think this could go into 2.9 if you can do so fairly quickly.

          Show
          Grant Ingersoll added a comment - Peter, can you bring this up to date? I think this could go into 2.9 if you can do so fairly quickly.
          Hide
          Peter Keegan added a comment -

          New version that works with current trunk (8/5/09)

          Show
          Peter Keegan added a comment - New version that works with current trunk (8/5/09)
          Hide
          Grant Ingersoll added a comment -

          Minor mods and some javadocs. Looks pretty good.

          I made sumPayloads more generic and protected, so that one could override it and do other things besides sum.

          Show
          Grant Ingersoll added a comment - Minor mods and some javadocs. Looks pretty good. I made sumPayloads more generic and protected, so that one could override it and do other things besides sum.
          Hide
          Grant Ingersoll added a comment -

          Committed revision 801667. thanks Peter!

          Show
          Grant Ingersoll added a comment - Committed revision 801667. thanks Peter!

            People

            • Assignee:
              Grant Ingersoll
              Reporter:
              Peter Keegan
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development