Lucene - Core
  1. Lucene - Core
  2. LUCENE-3665

Make WeightedSpanTermExtractor extensible to handle custom query implemenations

    Details

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

      Description

      Currently if I have a custom query which subclasses query directly I can't use the QueryScorer for highlighting since it does explicit instanceof checks. In some cases its is possible to rewrite the query before passing it to the highlighter to obtain a primitive query. However I had the usecase where this was not possible ie. the original index was not available on the machine which highlights the results. To still use the highlighter I had to copy a bunch of code due to visibility issues in those classes. I think we can make this extensible with minor effort to allow this usecase without massive code duplication.

      1. LUCENE-3665.patch
        15 kB
        Simon Willnauer

        Activity

        Hide
        Mark Miller added a comment -

        +1 - only looked at the patch, but looks good to me.

        Show
        Mark Miller added a comment - +1 - only looked at the patch, but looks good to me.
        Hide
        Simon Willnauer added a comment -

        I will commit this soon if nobody objects

        Show
        Simon Willnauer added a comment - I will commit this soon if nobody objects
        Hide
        Simon Willnauer added a comment -

        here is a patch including a testcases. I simply opened up the API a little and added two methods for subclassing.

        Show
        Simon Willnauer added a comment - here is a patch including a testcases. I simply opened up the API a little and added two methods for subclassing.

          People

          • Assignee:
            Simon Willnauer
            Reporter:
            Simon Willnauer
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development