org.apache.cocoon.components.search
Class SimpleLuceneXMLIndexerImpl

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.search.SimpleLuceneXMLIndexerImpl
All Implemented Interfaces:
Component, Configurable, LogEnabled, Serviceable, ThreadSafe, LuceneXMLIndexer

public class SimpleLuceneXMLIndexerImpl
extends AbstractLogEnabled
implements LuceneXMLIndexer, Configurable, Serviceable, ThreadSafe

A simple class building lucene documents from xml content.

It has two parameters that effect the way it works:

<store-fields/> Sets which tags in your content are stored in Lucene as fields, during the indexing process. Allows them to be output with search hits.

<content-view-query/> Sets the view the indexer will request for indexing content.

Example configuration (goes in cocoon.xconf)


     <lucene-xml-indexer logger="core.search.lucene">
       <store-fields>title, summary</store-fields>
       <content-view-query>cocoon-view=search</content-view-query>
     </lucene-xml-indexer>
   

Version:
CVS $Id: SimpleLuceneXMLIndexerImpl.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Bernhard Huber, Jeremy Quinn

Field Summary
static String CONTENT_VIEW_QUERY_CONFIG
          Config element name specifying query-string appendend for requesting links of an URL.
static String FIELDTAGS_CONFIG
          Config element name specifying the tags to be added as Stored, Untokenised, Unindexed Fields.
protected  ServiceManager manager
          The service manager instance
 
Fields inherited from interface org.apache.cocoon.components.search.LuceneXMLIndexer
BODY_FIELD, ROLE, UID_FIELD, URL_FIELD
 
Constructor Summary
SimpleLuceneXMLIndexerImpl()
           
 
Method Summary
 List build(URL url)
          Build lucenen documents from a URL
 void configure(Configuration configuration)
          configure
 void service(ServiceManager manager)
          Set the current ServiceManager instance used by this Serviceable.
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

manager

protected ServiceManager manager
The service manager instance

Since:

CONTENT_VIEW_QUERY_CONFIG

public static final String CONTENT_VIEW_QUERY_CONFIG
Config element name specifying query-string appendend for requesting links of an URL.

Its value is link-view-query.

Since:
See Also:
Constant Field Values

FIELDTAGS_CONFIG

public static final String FIELDTAGS_CONFIG
Config element name specifying the tags to be added as Stored, Untokenised, Unindexed Fields.

Its value is field-tags.

Since:
See Also:
Constant Field Values
Constructor Detail

SimpleLuceneXMLIndexerImpl

public SimpleLuceneXMLIndexerImpl()
Since:
Method Detail

configure

public void configure(Configuration configuration)
               throws ConfigurationException
configure

Specified by:
configure in interface Configurable
Parameters:
configuration -
Throws:
ConfigurationException
Since:

service

public void service(ServiceManager manager)
             throws ServiceException
Set the current ServiceManager instance used by this Serviceable.

Specified by:
service in interface Serviceable
Parameters:
manager - Description of Parameter
Throws:
ServiceException - Description of Exception
Since:

build

public List build(URL url)
           throws ProcessingException
Build lucenen documents from a URL

Specified by:
build in interface LuceneXMLIndexer
Parameters:
url - the content of this url gets indexed.
Throws:
ProcessingException - Description of Exception
Since:


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.