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

Implement toString() method in TermsFilter

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 3.5, 3.6
    • 4.1, 6.0
    • modules/other
    • None
    • New, Patch Available

    Description

      LUCENE-1049 introduced a enhanced implementation of the toString() method in the BooleanFilter clause.
      This was an improvement, however I'm still seeing a lot Lucene filter classes not overriding the toString method resulting in a toString returning the classname and the hashcode of the object.
      This can be useful sometimes, but it's totally not useful in my case.
      I want to see the properties set in the filters so I know which Lucene query was created.

      Now:
      BooleanFilter(+BooleanFilter(BooleanFilter(+org.apache.lucene.search.TermsFilter@ea81ba60 +org.apache.lucene.search.TermsFilter@26ea3cbc) BooleanFilter(+org.apache.lucene.search.TermsFilter@df621f09 +org.apache.lucene.search.TermsFilter@2f712446)))

      Wanted behavior:
      BooleanFilter(+BooleanFilter(BooleanFilter(+inStock:Y +barCode:12345678) BooleanFilter(+isHeavy:N +isDamaged:Y)))

      Attachments

        Activity

          People

            mikemccand Michael McCandless
            tcostermans Tim Costermans
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: