Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0-ALPHA
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      Currently there is an (expert) API in scorer to allow you to take a scorer, and visit its children etc (e.g. booleanquery).

      I think we should improve this, so its general to all queries.

      The current issues are:

      • the current api is hardcoded for booleanquery's Occurs, but we should support other types of children (e.g. disjunctionmax)
      • it can be difficult to use the API, because of the amount of generics and the visitor callback API.
      • the current API enforces a DFS traversal when you might prefer BFS instead.

        Activity

        Hide
        Robert Muir added a comment -

        here's a patch, i didnt add support for existing scorers though:

        in my opinion, all scorers that contain other scorers should implement this api so that you can traverse them.

        Show
        Robert Muir added a comment - here's a patch, i didnt add support for existing scorers though: in my opinion, all scorers that contain other scorers should implement this api so that you can traverse them.
        Hide
        Michael McCandless added a comment -

        I like this simplification! I agree baking in BQ's relationships into this Scorer API is not good, and it's better to let the caller decide how/when/what subs to visit.

        +1 to commit

        Show
        Michael McCandless added a comment - I like this simplification! I agree baking in BQ's relationships into this Scorer API is not good, and it's better to let the caller decide how/when/what subs to visit. +1 to commit
        Hide
        Robert Muir added a comment -

        Thanks for taking a look, if there are no objections i'll commit in a few days, and open a followup issue to ensure that all scorers support traversing, there are still a lot that need to implement the method in order to support access to any inner scorers.

        For example, in my opinion even ConstantScoreQuery shoudl allow you to get access to its inner scorer via some "CONSTANT_SCORED" relationship or similar.

        Show
        Robert Muir added a comment - Thanks for taking a look, if there are no objections i'll commit in a few days, and open a followup issue to ensure that all scorers support traversing, there are still a lot that need to implement the method in order to support access to any inner scorers. For example, in my opinion even ConstantScoreQuery shoudl allow you to get access to its inner scorer via some "CONSTANT_SCORED" relationship or similar.

          People

          • Assignee:
            Robert Muir
            Reporter:
            Robert Muir
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development