You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Koji Sekiguchi (JIRA)" <ji...@apache.org> on 2009/12/14 10:28:18 UTC

[jira] Issue Comment Edited: (SOLR-1653) add PatternReplaceCharFilter

    [ https://issues.apache.org/jira/browse/SOLR-1653?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12790056#action_12790056 ] 

Koji Sekiguchi edited comment on SOLR-1653 at 12/14/09 9:27 AM:
----------------------------------------------------------------

Ok. I'll show you same samples ;-)

||INPUT||groupedPattern||replaceGroups||OUTPUT||comment||
|see-ing looking|(\w+)(ing)|1|see-ing look|remove "ing" from the end of word|
|see-ing looking|(\w+)ing|1|see-ing look|same as above. 2nd parentheses can be omitted|
|No.1 NO. no.  543|[nN][oO]\.\s*(\d+)|{#},1|#1	NO.	#543|sample for literal. do not forget to set blockDelimiters other than period when you use period in groupedPattern|
|abc-1234-5678|(\w+)--(\d+)--(\d+)|3,{--},1,{--},2|5678-abc-1234|change the order of the groups|


      was (Author: koji):
    Ok. I'll show you same samples ;-)

||INPUT||groupedPattern||replaceGroups||OUTPUT||comment||
|see-ing looking|(\w+)(ing)|1|see-ing look|remove "ing" from the end of word|
|see-ing looking|(\w+)ing|1|see-ing look|same as above. 2nd parentheses can be omitted|
|No.1 NO. no.  543|[nN][oO]\.\s*(\d+)|{#},1|#1	NO.	#543|sample for literal. do not forget to set blockDelimiters other than period when you use period in groupedPattern|
|abc-1234-5678|(\w+)-(\d+)-(\d+)|3,{-},1,{-},2|5678-abc-1234|change the order of the groups|

  
> add PatternReplaceCharFilter
> ----------------------------
>
>                 Key: SOLR-1653
>                 URL: https://issues.apache.org/jira/browse/SOLR-1653
>             Project: Solr
>          Issue Type: New Feature
>          Components: Schema and Analysis
>    Affects Versions: 1.4
>            Reporter: Koji Sekiguchi
>            Assignee: Koji Sekiguchi
>            Priority: Minor
>             Fix For: 1.5
>
>         Attachments: SOLR-1653.patch
>
>
> Add a new CharFilter that uses a regular expression for the target of replace string in char stream.
> Usage:
> {code:title=schema.xml}
> <fieldType name="textCharNorm" class="solr.TextField" positionIncrementGap="100" >
>   <analyzer>
>     <charFilter class="solr.PatternReplaceCharFilterFactory"
>                 groupedPattern="([nN][oO]\.)\s*(\d+)"
>                 replaceGroups="1,2" blockDelimiters=":;"/>
>     <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
>     <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>   </analyzer>
> </fieldType>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.