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

Support iteration of sub-matches in join queries (ToParentBlockJoinQuery / ToChildBlockJoinQuery)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • None
    • None
    • modules/join
    • None
    • New

    Description

      It would be nice to be able to iterate over the "sub-matches" in these join queries for the purpose of faceting (or possibly other use-cases?).

      For example, we have a use-case where our query matches on "child" docs, using a ToParentBlockJoinQuery to "emit" the associated parents, which are ultimately added to our match set. But, we want to iterate over the matching "children" for the purpose of faceting.

      To make it concrete, consider searching over a product catalog where "offers" and "items" are indexed side-by-side, with the offers being represented as "children" of the parent items. An offer contains information like "condition" (new vs. used), selling price, etc. for the parent item. If we want to facet on "condition", we want to observe all children that matched the query to know if the parent item had a "new" or "used" offer (or both). This requires iterating over the child matches when faceting, which we cannot do today since the child hit information isn't retained anywhere.

      We can support this by "caching" the child hits in a bitset but there is some complexity when multiple join queries appear in a query structure (would need to logically combine various "cached" bitsets using the same boolean operations as in the original query structure).

      Attachments

        Activity

          People

            Unassigned Unassigned
            gsmiller Greg Miller
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: