Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-9912 SimpleFacets - support facet.excludeTerms parameter
  3. SOLR-9914

SimpleFacets: refactor "contains" check into "SubstringBytesRefFilter" class

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.5, 7.0
    • Component/s: None
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      None
    • Flags:
      Patch

      Description

      This patch refactors the "contains" logic for only including constraints which contain a given substring, into a "Predicate<BytesRef>" interface and "SubstringBytesRefFilter" implementation.
      This allows users to have custom logic for including terms in the filter counts, not only based on substring matches.

      1. SOLR-9914.patch
        20 kB
        Jonny Marks
      2. SOLR-9914.patch
        18 kB
        Jonny Marks
      3. SOLR-9914.patch
        19 kB
        Jonny Marks

        Issue Links

          Activity

          Hide
          dsmiley David Smiley added a comment -

          I don't think we need the interface BytesRefFilter when a Predicate<BytesRef> will do the job fine?

          Show
          dsmiley David Smiley added a comment - I don't think we need the interface BytesRefFilter when a Predicate<BytesRef> will do the job fine?
          Hide
          cpoerschke Christine Poerschke added a comment -

          Java8 Predicate<T> - hadn't come across that before, thanks for the pointer.

          Yes, Predicate<BytesRef> seems very suitable for the job here and would also simplify the MultiBytesRefFilter implementation in the SOLR-9912 parent task's patch.

          Jonny - what do you think?

          Show
          cpoerschke Christine Poerschke added a comment - Java8 Predicate<T> - hadn't come across that before, thanks for the pointer. Yes, Predicate<BytesRef> seems very suitable for the job here and would also simplify the MultiBytesRefFilter implementation in the SOLR-9912 parent task's patch. Jonny - what do you think?
          Hide
          jm100 Jonny Marks added a comment -

          Thanks for the suggestion David Smiley, I've updated the patch to use Predicate.

          Show
          jm100 Jonny Marks added a comment - Thanks for the suggestion David Smiley , I've updated the patch to use Predicate.
          Hide
          dsmiley David Smiley added a comment -

          I don't think SimpleFacets.contains needs to stick around and be deprecated; just outright delete it if there are no callers within the codebase.

          Otherwise +1; this is a nice generalization.

          Show
          dsmiley David Smiley added a comment - I don't think SimpleFacets.contains needs to stick around and be deprecated; just outright delete it if there are no callers within the codebase. Otherwise +1; this is a nice generalization.
          Hide
          jm100 Jonny Marks added a comment -

          Removed SimpleFacets.contains

          Show
          jm100 Jonny Marks added a comment - Removed SimpleFacets.contains
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 55afc2031c7aeb75f23e66f9817131cd3798a5b2 in lucene-solr's branch refs/heads/master from Christine Poerschke
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=55afc20 ]

          SOLR-9914: SimpleFacets: refactor "contains" check into "SubstringBytesRefFilter" class. (Jonny Marks, David Smiley, Christine Poerschke)

          Show
          jira-bot ASF subversion and git services added a comment - Commit 55afc2031c7aeb75f23e66f9817131cd3798a5b2 in lucene-solr's branch refs/heads/master from Christine Poerschke [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=55afc20 ] SOLR-9914 : SimpleFacets: refactor "contains" check into "SubstringBytesRefFilter" class. (Jonny Marks, David Smiley, Christine Poerschke)
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit fd048597dd9c4f762cb7cc437f98276f9d29ab0e in lucene-solr's branch refs/heads/branch_6x from Christine Poerschke
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=fd04859 ]

          SOLR-9914: SimpleFacets: refactor "contains" check into "SubstringBytesRefFilter" class. (Jonny Marks, David Smiley, Christine Poerschke)

          Show
          jira-bot ASF subversion and git services added a comment - Commit fd048597dd9c4f762cb7cc437f98276f9d29ab0e in lucene-solr's branch refs/heads/branch_6x from Christine Poerschke [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=fd04859 ] SOLR-9914 : SimpleFacets: refactor "contains" check into "SubstringBytesRefFilter" class. (Jonny Marks, David Smiley, Christine Poerschke)
          Hide
          cpoerschke Christine Poerschke added a comment -

          Jonny, thanks for the nice generalisation refactor patch (and revisions).

          David, thanks for additional reviewer comments.

          Show
          cpoerschke Christine Poerschke added a comment - Jonny, thanks for the nice generalisation refactor patch (and revisions). David, thanks for additional reviewer comments.

            People

            • Assignee:
              cpoerschke Christine Poerschke
              Reporter:
              jm100 Jonny Marks
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development