| org.apache.cocoon.transformation.AbstractTransformer org.apache.cocoon.transformation.LuceneIndexTransformer2
LuceneIndexTransformer2 | public class LuceneIndexTransformer2 extends AbstractTransformer implements Recyclable,Serviceable,Configurable(Code) | | Another lucene index transformer. allow
- index function (update indexing or add indexing if clear attribute is
true)
- lucene field boosting
- delete function
This tranformer used several avalon components, but you can use them
separatly :
- AnalyzerManager: you can setup a analyzer (configurable) in the
analyzer_manager tag in cocoon.xconf file
- IndexManager: you can setup a index in a the /WEB-INF/index.xml (default
location , but you can specify the location in the IndexManager component
configuration in cocoon.xconf file)
- Indexer (2 implementations: default (with update optimization) and
parallel implementation for multiple cpu)
Example of input source:
- to Index
<lucene:index xmlns:lucene="http://apache.org/cocoon/lucene/1.0"
indexid="myindex"
clear="true" (optinal attribute: clear index) merge-factor="100">
(optinal attribute: see lucene doc)
<lucene:document uid="http://myhost/myfile1.data">
<lucene:field name="tile" > sqdqsdq </lucene:field>
<lucene:field name="description" > a text bla bal blalael
balbal</lucene:field>
<lucene:field name="date" >10/12/2002</lucene:field>
</lucene:document>
<lucene:document uid="http://myhost/myfile2.data" >
<lucene:field name="author" boost="2" >Mr Author </lucene:field>
(boost the field for the search (see Lucene documentation))
<lucene:field name="langage" >french</lucene:field>
</lucene:document>
< /lucene:index>
- To delete
<lucene:delete indexid="myindex" >
<lucene:document uid="http://myhost/myfile.data" >
<lucene:document uid="EODOED-EFE"
</lucene:delete>
Example of Output Source
<page xmlns:lucene="http://apache.org/cocoon/lucene/1.0">
< lucene:index >
<lucene:document uid="http://myhost/myfile1.data"/>
<lucene:document uid="http://myhost/myfile2.data"/>
</lucene:index>
<lucene:delete > <lucene:document
uid="http://myhost/myfile1.data"/> <lucene:document
uid="EODOED-EFE"/> </lucene:delete >
author: Nicolas Maisonneuve |
Method Summary | |
protected boolean | canIndex() | public void | characters(char[] ch, int start, int length) | void | closeIndexer() | public void | configure(Configuration config) | public void | endDocument() | public void | endElement(String namespaceURI, String localName, String qName) | public void | endPrefixMapping(String prefix) End the scope of a prefix-URI mapping. | protected String | getExceptionMessage(Exception ex) | void | handleError(String message, Exception ex) | void | handleError(Exception ex) | void | handleError(String msg) | public void | recycle() | public void | service(ServiceManager manager) | public void | setup(SourceResolver resolver, Map objectModel, String src, Parameters parameters) Setup the transformer. | public void | startDocument() | public void | startElement(String namespaceURI, String localName, String qName, Attributes atts) | public void | startPrefixMapping(String prefix, String uri) Begin the scope of a prefix-URI Namespace mapping. |
DELETE_PROCESS | final public static int DELETE_PROCESS(Code) | | |
DELETING_PROCESS | final public static int DELETING_PROCESS(Code) | | |
DIRECTORY_DEFAULT | final public static String DIRECTORY_DEFAULT(Code) | | |
INDEX_PROCESS | final public static int INDEX_PROCESS(Code) | | |
IN_DOCUMENT_PROCESS | final public static int IN_DOCUMENT_PROCESS(Code) | | |
IN_FIELD_PROCESS | final public static int IN_FIELD_PROCESS(Code) | | |
LUCENE_DELETING_ELEMENT | final public static String LUCENE_DELETING_ELEMENT(Code) | | action element: delete doc
|
LUCENE_DOCUMENT_ELEMENT | final public static String LUCENE_DOCUMENT_ELEMENT(Code) | | Lucene document element
|
LUCENE_DOCUMENT_UID_ATTRIBUTE | final public static String LUCENE_DOCUMENT_UID_ATTRIBUTE(Code) | | Lucene document uid field
|
LUCENE_FIELD_BOOST_ATTRIBUTE | final public static String LUCENE_FIELD_BOOST_ATTRIBUTE(Code) | | Optional attribute: lucene field boost (see lucene docs)
|
LUCENE_FIELD_ELEMENT | final public static String LUCENE_FIELD_ELEMENT(Code) | | lucene field element
|
LUCENE_FIELD_NAME_ATTRIBUTE | final public static String LUCENE_FIELD_NAME_ATTRIBUTE(Code) | | lucene field name
|
LUCENE_INDEXING_ANALYZER_ATTRIBUTE | final public static String LUCENE_INDEXING_ANALYZER_ATTRIBUTE(Code) | | Optional attribute: Analyzer identity: see analyzerManager Component
(default: the analyer of the index declared in the index definition)
|
LUCENE_INDEXING_CREATE_ATTRIBUTE | final public static String LUCENE_INDEXING_CREATE_ATTRIBUTE(Code) | | Optional attribute: Clear index: true/false (default: false)
|
LUCENE_INDEXING_ELEMENT | final public static String LUCENE_INDEXING_ELEMENT(Code) | | action element : index doc
|
LUCENE_INDEXING_INDEXID_ATTRIBUTE | final public static String LUCENE_INDEXING_INDEXID_ATTRIBUTE(Code) | | index identity (see index definition file)
|
LUCENE_INDEXING_MERGE_FACTOR_ATTRIBUTE | final public static String LUCENE_INDEXING_MERGE_FACTOR_ATTRIBUTE(Code) | | Optional attribute: MergeFactor number (default 10): improve the indexing
speed for large indexing (see Lucene docs)
|
NO_PROCESSING | final public static int NO_PROCESSING(Code) | | |
canIndex | protected boolean canIndex()(Code) | | |
characters | public void characters(char[] ch, int start, int length) throws SAXException(Code) | | |
configure | public void configure(Configuration config) throws ConfigurationException(Code) | | |
endPrefixMapping | public void endPrefixMapping(String prefix) throws SAXException(Code) | | End the scope of a prefix-URI mapping.
Parameters: prefix - The prefix that was being mapping. |
recycle | public void recycle()(Code) | | |
service | public void service(ServiceManager manager) throws ServiceException(Code) | | |
startPrefixMapping | public void startPrefixMapping(String prefix, String uri) throws SAXException(Code) | | Begin the scope of a prefix-URI Namespace mapping.
Parameters: prefix - The Namespace prefix being declared. Parameters: uri - The Namespace URI the prefix is mapped to. |
|
|