Lucene - Core
  1. Lucene - Core
  2. LUCENE-2007

Add DocsetQuery to turn a DocIdSet into a query

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core/search
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      Added a class DocsetQuery that can be constructed from a DocIdSet.

      1. LUCENE-2007.patch
        5 kB
        John Wang
      2. LUCENE-2007-2.patch
        5 kB
        John Wang

        Activity

        Hide
        Paul Elschot added a comment -

        Could ConstantScoreQuery(Filter) be used for this?

        Show
        Paul Elschot added a comment - Could ConstantScoreQuery(Filter) be used for this?
        Hide
        John Wang added a comment -

        contributed from bobo.
        Still work needed:

        1) reader.isDeleted is now called. Which perhaps should be optimized to avoid synchronized call.
        2) don''t what the query syntax would be for this, so toString is not properly implemented.

        Show
        John Wang added a comment - contributed from bobo. Still work needed: 1) reader.isDeleted is now called. Which perhaps should be optimized to avoid synchronized call. 2) don''t what the query syntax would be for this, so toString is not properly implemented.
        Hide
        John Wang added a comment -

        fixed to use reader.termDocs(null) for delete check.

        Show
        John Wang added a comment - fixed to use reader.termDocs(null) for delete check.
        Hide
        Uwe Schindler added a comment -

        It is exactly the same like ConstantScoreQuery, the only difference is that it gets an DocIdSet as parameter. My problem with it: How should this work with Multi-Segment indexes (because search is done on each segment) and once the iterator is exhausted it cannot be used anymore and how does the query know, for which segment the query applies?

        Show
        Uwe Schindler added a comment - It is exactly the same like ConstantScoreQuery, the only difference is that it gets an DocIdSet as parameter. My problem with it: How should this work with Multi-Segment indexes (because search is done on each segment) and once the iterator is exhausted it cannot be used anymore and how does the query know, for which segment the query applies?
        Hide
        John Wang added a comment -

        Both Paul and Uwe are absolutely correct!
        I had blindly add this without looking around to see other solutions within Lucene.
        The constructor of ConstantScoreQuery using Filter is exactly the answer to Uwe's question on segmented readers.
        Thanks!

        -John

        Show
        John Wang added a comment - Both Paul and Uwe are absolutely correct! I had blindly add this without looking around to see other solutions within Lucene. The constructor of ConstantScoreQuery using Filter is exactly the answer to Uwe's question on segmented readers. Thanks! -John

          People

          • Assignee:
            Unassigned
            Reporter:
            John Wang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development