<bean id="FooToBar" class="com.google.enterprise.connector.util.filter.ModifyPropertyFilter"> <property name="propertyName" value="Category"/> <property name="pattern" value="Foo"/> <property name="replacement" value="Bar"/> <property name="overwrite" value="true"/> </bean>
The following example adds "Paul Erdös" to the list of {@code Authors}of documents for which I am also an author. This will give me an Erdös Number of 1! <!-- Add Erdös as co-author of all my documents. --> <bean id="AddErdosAuthor" class="com.google.enterprise.connector.util.filter.AddPropertyFilter"> <property name="propertyName" value="Author"/> <property name="pattern" value="C'est Moi"/> <property name="replacement" value="Paul Erdös"/> <property name="overwrite" value="false"/> </bean>
The following example replaces one or more instances of the characters '.' or '_' with a single space for all values of the {@code Foo} and{@code Bar} properties. The original values are kept, and new valueswith whitespace delimiters are added to the properties. <!-- Replace '.' and '_' with a space. --> <bean id="DotUnderscoreToWhiteSpace" class="com.google.enterprise.connector.util.filter.ModifyPropertyFilter"> <property name="propertyNames"> <set> <value>Foo</value> <value>Bar</value> </set> </property> <property name="pattern" value="[_.]+"/> <property name="replacement" value=" "/> <property name="overwrite" value="false"/> </bean>
When used with binary values, the entire value is buffered and the modified value is stored in a {@code byte} array. @since 2.8
|
|