.
- Conector Manager Filter란
- 기존 GSA 커넥터를 사용하여 개발시
커스터 마이징이 필요이 필요한 경우,
기본적으로 제공하는 FIlter
- FIlter의 설정 방법
- documentFilter.xml에 documentFilterChain bean안에 설정
- FIlter의 종류
- 기존 GSA 커넥터를 사용하여 개발시커스터 마이징이 필요이 필요한 경우,
기본적으로 제공하는 FIlter
- documentFilter.xml에 documentFilterChain bean안에 설정
- AbstractDocumentFilter
- DocumentFilter를 만들기 위한 기본 추상 클래스
- DocumentFilterChain
- FIlter를 사용할 Document를 가지고 있는 클래스
- 기존 커넥터 사용시
documentFIlter.xml파일에 Default로 설정되어있음
- ACLPropertyFilter
- ACL Property의 설정을 추가,변경 할수 있는 FIlter
- AddPropertyFilter
- Document에 새로운 Property를 추가할수 있는 FIlter
<!-- Tag all documents fed from this department with a source ID. -->
<bean class="com.google.enterprise.connector.util.filter.AddPropertyFilter" id="AddDeptId">
<property name="propertyName" value="DeptId">
<property name="propertyValue" value="Finance">
<property name="overwrite" value="true">
</property></property></property></bean>
- CopyPropertyFilter
- 기존에 있는 Property의 값을 원하는 Property의 값에 세팅하는 Filter
<!-- Make news articles appear in title and author searches. -->
<bean class="com.google.enterprise.connector.util.filter.CopyPropertyFilter" id="MoveNewsProps">
<property name="propertyNameMap">
<map>
<entry key="HeadLine" value="Title">
<entry key="ByLine" value="Author">
</entry></entry></map>
</property>
<property name="overwrite" value="false">
</property></bean>
- DeletePropertyFilter
- Property의 값을 삭제하는 Filter
<!-- Remove Department and Section properties. -->
<bean class="com.google.enterprise.connector.util.filter.DeletePropertyFilter" id="DeleteDeptAndSect">
<property name="propertyNames">
<set>
<value>Department</value>
<value>Section</value>
</set>
</property>
</bean>
- ModifyPropertyFIlter
-
Property의 값을 수정하는 Filter ( 정규식 사용 가능)
<bean class="com.google.enterprise.connector.util.filter.ModifyPropertyFilter" id="FooToBar">
<property name="propertyName" value="Category">
<property name="pattern" value="Foo">
<property name="replacement" value="Bar">
<property name="overwrite" value="true">
</property></property></property></property></bean>
수정후 추가 예제
<!-- Add Erdös as co-author of all my documents. -->
<bean class="com.google.enterprise.connector.util.filter.AddPropertyFilter" id="AddErdosAuthor">
<property name="propertyName" value="Author">
<property name="pattern" value="C'est Moi">
<property name="replacement" value="Paul Erdös">
<property name="overwrite" value="false">
</property></property></property></property></bean>
정규식 예제
<!-- Replace '.' and '_' with a space. -->
<bean class="com.google.enterprise.connector.util.filter.ModifyPropertyFilter" id="DotUnderscoreToWhiteSpace">
<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">
</property></property></property></bean>
- MovePropertyFilter
- SkipDocumentFIlter
관련 링크
OpenSource ConnectorManager : Google ConnectorManager
- AbstractDocumentFilter
- DocumentFilter를 만들기 위한 기본 추상 클래스
- DocumentFilterChain
- FIlter를 사용할 Document를 가지고 있는 클래스
- 기존 커넥터 사용시
documentFIlter.xml파일에 Default로 설정되어있음
- ACLPropertyFilter
- ACL Property의 설정을 추가,변경 할수 있는 FIlter
- Document에 새로운 Property를 추가할수 있는 FIlter
<!-- Tag all documents fed from this department with a source ID. --> <bean class="com.google.enterprise.connector.util.filter.AddPropertyFilter" id="AddDeptId"> <property name="propertyName" value="DeptId"> <property name="propertyValue" value="Finance"> <property name="overwrite" value="true"> </property></property></property></bean>
- 기존에 있는 Property의 값을 원하는 Property의 값에 세팅하는 Filter
<!-- Make news articles appear in title and author searches. --> <bean class="com.google.enterprise.connector.util.filter.CopyPropertyFilter" id="MoveNewsProps"> <property name="propertyNameMap"> <map> <entry key="HeadLine" value="Title"> <entry key="ByLine" value="Author"> </entry></entry></map> </property> <property name="overwrite" value="false"> </property></bean>
- Property의 값을 삭제하는 Filter
<!-- Remove Department and Section properties. --> <bean class="com.google.enterprise.connector.util.filter.DeletePropertyFilter" id="DeleteDeptAndSect"> <property name="propertyNames"> <set> <value>Department</value> <value>Section</value> </set> </property> </bean>
- Property의 값을 수정하는 Filter ( 정규식 사용 가능)
<bean class="com.google.enterprise.connector.util.filter.ModifyPropertyFilter" id="FooToBar"> <property name="propertyName" value="Category"> <property name="pattern" value="Foo"> <property name="replacement" value="Bar"> <property name="overwrite" value="true"> </property></property></property></property></bean>
수정후 추가 예제
<!-- Add Erdös as co-author of all my documents. --> <bean class="com.google.enterprise.connector.util.filter.AddPropertyFilter" id="AddErdosAuthor"> <property name="propertyName" value="Author"> <property name="pattern" value="C'est Moi"> <property name="replacement" value="Paul Erdös"> <property name="overwrite" value="false"> </property></property></property></property></bean>
정규식 예제
<!-- Replace '.' and '_' with a space. --> <bean class="com.google.enterprise.connector.util.filter.ModifyPropertyFilter" id="DotUnderscoreToWhiteSpace"> <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"> </property></property></property></bean>
댓글 없음:
댓글 쓰기