Solr
  1. Solr
  2. SOLR-1625

Add regexp support for TermsComponent

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 1.5, 3.1, 4.0-ALPHA
    • Component/s: search
    • Labels:
      None

      Description

      At the moment the only way to filter the returned terms is by a prefix. It would be nice it the filter could also be done by regular expression

      1. SOLR-1625.patch
        8 kB
        Uri Boness
      2. SOLR-1625.patch
        6 kB
        Uri Boness
      3. SOLR-1625.patch
        4 kB
        Uri Boness

        Activity

        Hide
        Grant Ingersoll added a comment -

        Bulk close for 3.1.0 release

        Show
        Grant Ingersoll added a comment - Bulk close for 3.1.0 release
        Hide
        Hoss Man added a comment -

        Correcting Fix Version based on CHANGES.txt, see this thread for more details...

        http://mail-archives.apache.org/mod_mbox/lucene-dev/201005.mbox/%3Calpine.DEB.1.10.1005251052040.24672@radix.cryptio.net%3E

        Show
        Hoss Man added a comment - Correcting Fix Version based on CHANGES.txt, see this thread for more details... http://mail-archives.apache.org/mod_mbox/lucene-dev/201005.mbox/%3Calpine.DEB.1.10.1005251052040.24672@radix.cryptio.net%3E
        Hide
        Leandro Hermida added a comment -

        Hi,

        Just tested this feature with the 1.5-dev nightly build it works great

        -Leandro

        Show
        Leandro Hermida added a comment - Hi, Just tested this feature with the 1.5-dev nightly build it works great -Leandro
        Hide
        Noble Paul added a comment -

        committed r889537
        Thanks Uri Boness

        Show
        Noble Paul added a comment - committed r889537 Thanks Uri Boness
        Hide
        Uri Boness added a comment -

        Updated the patch to support the following changes (as discussed above):

        • using "terms.regex" param (instead of "terms.regexp")
        • using more explicit names for the regex flags
        Show
        Uri Boness added a comment - Updated the patch to support the following changes (as discussed above): using "terms.regex" param (instead of "terms.regexp") using more explicit names for the regex flags
        Hide
        Uri Boness added a comment -

        regexp vs. regex -> I really don't know. I always use/d regexp, but I guess we need to come up with something that is consistent with Solr. The first thing that comes to mind with a regular expression configuration in Solr is the highlighting component and indeed it uses "regex", so it's best to stick to that.

        have expplicit strings like regex.flag=case_sensitive&regex.flag=multiline

        Yeah... I had this feeling as well, but I thought it might be too many extra parameters just for the regular expression support. If you think that's best I can add it.

        I'll make the changes tonight and submit a new patch.

        Show
        Uri Boness added a comment - regexp vs. regex -> I really don't know. I always use/d regexp, but I guess we need to come up with something that is consistent with Solr. The first thing that comes to mind with a regular expression configuration in Solr is the highlighting component and indeed it uses "regex", so it's best to stick to that. have expplicit strings like regex.flag=case_sensitive&regex.flag=multiline Yeah... I had this feeling as well, but I thought it might be too many extra parameters just for the regular expression support. If you think that's best I can add it. I'll make the changes tonight and submit a new patch.
        Hide
        Noble Paul added a comment -

        a few comments
        isn't regex' better than 'regexp'

        The regexp.hints is not very clear. users will not be able to understand it.

        have expplicit strings like regex.flag=case_sensitive&regex.flag=multiline

        Show
        Noble Paul added a comment - a few comments isn't regex' better than 'regexp' The regexp.hints is not very clear. users will not be able to understand it. have expplicit strings like regex.flag=case_sensitive&regex.flag=multiline
        Hide
        Uri Boness added a comment -

        Added support for regexp hints based on the different constants in the Pattern class. The terms.regexp.hints parameter accepts an int value corresponding to the value passed to the Pattern.compile(String expression, int hints) factory method.

        Using hints it is now possible to support case insensitive patterns.

        Show
        Uri Boness added a comment - Added support for regexp hints based on the different constants in the Pattern class. The terms.regexp.hints parameter accepts an int value corresponding to the value passed to the Pattern.compile(String expression, int hints) factory method. Using hints it is now possible to support case insensitive patterns.

          People

          • Assignee:
            Noble Paul
            Reporter:
            Uri Boness
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development