Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: 3.6, 4.0-ALPHA
    • Component/s: update
    • Labels:

      Description

      A processor for search/replace in a field using RegEx.

      Kindly donated by Oslo University

      1. SOLR-2825.patch
        10 kB
        Jan Høydahl

        Issue Links

          Activity

          Hide
          Jan Høydahl added a comment -

          First version. This has been running stable in production for some time. Comments welcome.

          Show
          Jan Høydahl added a comment - First version. This has been running stable in production for some time. Comments welcome.
          Hide
          Jan Høydahl added a comment -

          Example usage, to remove excess whitespace from a few fields:

          <processor class="org.apache.solr.update.processor.RegexpReplaceProcessorFactory">
            <bool name="enabled">true</bool>
            <str name="fl">content_no content_en</str>
            <str name="pattern">\s+</str>
            <str name="replacement"></str>
          </processor>
          
          Show
          Jan Høydahl added a comment - Example usage, to remove excess whitespace from a few fields: <processor class= "org.apache.solr.update.processor.RegexpReplaceProcessorFactory" > <bool name= "enabled" > true </bool> <str name= "fl" >content_no content_en</str> <str name= "pattern" >\s+</str> <str name= "replacement" ></str> </processor>
          Hide
          Jan Høydahl added a comment -

          Replacing wrong patch with correct one

          Show
          Jan Høydahl added a comment - Replacing wrong patch with correct one
          Hide
          Hoss Man added a comment -

          Jan: in the latest patch on SOLR-2802, i refactored the code you have here to use those base classes – letting them benefit from the field selector syntax provide in that patch.

          please take a look and let me know what you think – the only functionality i didn't preserve is the "enabled" logic which is a great idea and really seems like something we should handle in the UpdateRequestProcessorChain class as a first-order feature for all processors – i'm going to open a new Jira for that.

          Show
          Hoss Man added a comment - Jan: in the latest patch on SOLR-2802 , i refactored the code you have here to use those base classes – letting them benefit from the field selector syntax provide in that patch. please take a look and let me know what you think – the only functionality i didn't preserve is the "enabled" logic which is a great idea and really seems like something we should handle in the UpdateRequestProcessorChain class as a first-order feature for all processors – i'm going to open a new Jira for that.
          Hide
          Jan Høydahl added a comment -

          Fixed as part of SOLR-2802

          Show
          Jan Høydahl added a comment - Fixed as part of SOLR-2802

            People

            • Assignee:
              Jan Høydahl
              Reporter:
              Jan Høydahl
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development