Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-4768

Child Traversable To Parent Block Join Query

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • core/query/scoring
    • None
    • trunk
      git rev-parse HEAD
      5cc88eaa41eb66236a0d4203cc81f1eed97c9a41

    • New

    Description

      Hi everyone!

      Let me describe what i am trying to do:
      I have hierarchical documents ('car model' as parent, 'trim' as child) and use block join queries to retrieve them. However, i am not happy with current behavior of ToParentBlockJoinQuery which goes through all parent childs during nextDoc call (accumulating scores and freqs).

      Consider the following example, you have a query with a custom post condition on top of such bjq: and during post condition you traverse scorers tree (doc-at-time) and want to manually push child scorers of bjq one by one until condition passes or current parent have no more childs.

      I am attaching the patch with query(and some tests) similar to ToParentBlockJoin but with an ability to traverse childs. (i have to do weird instance of check and cast inside my code) This is a draft only and i will be glad to hear if someone need it or to hear how we can improve it.

      P.s i believe that proposed query is more generic (low level) than ToParentBJQ and ToParentBJQ can be extended from it and call nextChild() internally during nextDoc().

      Also, i think that the problem of traversing hierarchical documents is more complex as lucene have only nextDoc API. What do you think about making api more hierarchy aware? One level document is a special case of multi level document but not vice versa. WDYT?

      Thanks in advance.

      Attachments

        1. LUCENE-4768-draft.patch
          28 kB
          Vadim Kirilchuk

        Activity

          People

            Unassigned Unassigned
            vkirilchuk Vadim Kirilchuk
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: