Java Doc for LuceneIndexTransformer.java in  » Content-Management-System » apache-lenya-2.0 » org » apache » cocoon » transformation » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » apache lenya 2.0 » org.apache.cocoon.transformation 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.cocoon.transformation.AbstractTransformer
   org.apache.cocoon.transformation.LuceneIndexTransformer

LuceneIndexTransformer
public class LuceneIndexTransformer extends AbstractTransformer implements CacheableProcessingComponent,Configurable,Contextualizable(Code)

A lucene index creation transformer.

This transformer reads a document with elements in the namespace http://apache.org/cocoon/lucene/1.0, and creates a new Lucene Index, or updates an existing one.

It has several parameters which can be set in the sitemap component configuration or as parameters to the transformation step in the pipeline, or finally as attributes of the root element in the source XML document. The source document over-rides the transformation parameters, which in turn over-ride any configuration parameters.

directory

Location of directory where index files are stored. This path is relative to the Cocoon work directory

create

This attribute controls whether the index is recreated.

  • If create = "false" and the index already exists then the index will be updated. Any documents which had already been indexed will be removed from the index and reinserted.

  • If the index does not exist then it will be created even if create="false".

  • If create="true" then any existing index will be destroyed and a new index created. If you are rebuilding your entire index then you should set create="true" because the indexer doesn't need to remove old documents from the index, so it will be faster.

max-field-length

Maximum number of terms to index in a field (as far as the index is concerned, the document will effectively be truncated at this point. The default value, 10k, may not be sufficient for large documents.

analyzer

Class name of the Lucene text analyzer to use. Typically depends on the language of the text being indexed. See the Lucene documentation for more information.

merge-factor
Determines how often segment indices are merged. See the Lucene documentation for more information.
A simple example of the input:
<?xml version="1.0" encoding="UTF-8"?>
 <lucene:index xmlns:lucene="http://apache.org/cocoon/lucene/1.0" 
 merge-factor="20" 
 create="false" 
 directory="index" 
 max-field-length="10000"
 analyzer="org.apache.lucene.analysis.standard.StandardAnalyzer">
 <lucene:document url="a.html">
 <documentTitle lucene:store="true">Doggerel</documentTitle>
 <body>The quick brown fox jumped over the lazy dog</body>    
 </lucene:document>
 <lucene:document url="b.html">
 <documentTitle lucene:store="true">Lorem Ipsum</documentTitle>
 <body>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</body>
 <body>Nunc a mauris blandit ligula scelerisque tristique.</body>    
 </lucene:document>
 </lucene:index>
 

author:
   Vadim Gritsenko
author:
   Conal Tuohy
version:
   $Id: LuceneIndexTransformer.java 433543 2006-08-22 06:22:54Z crossley $

Inner Class :static class IndexHelperField
Inner Class :static class IndexerConfiguration

Field Summary
final public static  StringANALYZER_CLASSNAME_CONFIG
    
final public static  StringANALYZER_CLASSNAME_DEFAULT
    
final public static  StringANALYZER_CLASSNAME_PARAMETER
    
final public static  StringCDATA
    
final public static  StringDIRECTORY_CONFIG
    
final public static  StringDIRECTORY_DEFAULT
    
final public static  StringDIRECTORY_PARAMETER
    
final public static  StringLUCENE_DOCUMENT_ELEMENT
    
final public static  StringLUCENE_DOCUMENT_URL_ATTRIBUTE
    
final public static  StringLUCENE_ELAPSED_TIME_ATTRIBUTE
    
final public static  StringLUCENE_ELEMENT_ATTR_STORE_VALUE
    
final public static  StringLUCENE_ELEMENT_ATTR_TO_TEXT_ATTRIBUTE
    
final public static  StringLUCENE_QUERY_ANALYZER_ATTRIBUTE
    
final public static  StringLUCENE_QUERY_CREATE_ATTRIBUTE
    
final public static  StringLUCENE_QUERY_DIRECTORY_ATTRIBUTE
    
final public static  StringLUCENE_QUERY_ELEMENT
    
final public static  StringLUCENE_QUERY_MAX_FIELD_LENGTH_ATTRIBUTE
    
final public static  StringLUCENE_QUERY_MERGE_FACTOR_ATTRIBUTE
    
final public static  StringLUCENE_URI
    
final public static  StringMAX_FIELD_LENGTH_CONFIG
    
final public static  intMAX_FIELD_LENGTH_DEFAULT
    
final public static  StringMAX_FIELD_LENGTH_PARAMETER
    
final public static  StringMERGE_FACTOR_CONFIG
    
final public static  intMERGE_FACTOR_DEFAULT
    
final public static  StringMERGE_FACTOR_PARAMETER
    
protected  FileworkDir
    


Method Summary
public  voidcharacters(char[] ch, int start, int length)
    
public  voidconfigure(Configuration conf)
     Configure the transformer.
public  voidcontextualize(Context context)
    
public  voidendDocument()
    
public  voidendElement(String namespaceURI, String localName, String qName)
    
public  voidendPrefixMapping(String prefix)
     End the scope of a prefix-URI mapping.
public  SerializablegetKey()
     Generate the unique key.
public  SourceValiditygetValidity()
     Generate the validity object.
public  voidrecycle()
    
public  voidsetup(SourceResolver resolver, Map objectModel, String src, Parameters parameters)
     Setup the transformer.
public  voidstartDocument()
    
public  voidstartElement(String namespaceURI, String localName, String qName, Attributes atts)
    
public  voidstartPrefixMapping(String prefix, String uri)
     Begin the scope of a prefix-URI Namespace mapping.

Field Detail
ANALYZER_CLASSNAME_CONFIG
final public static String ANALYZER_CLASSNAME_CONFIG(Code)



ANALYZER_CLASSNAME_DEFAULT
final public static String ANALYZER_CLASSNAME_DEFAULT(Code)



ANALYZER_CLASSNAME_PARAMETER
final public static String ANALYZER_CLASSNAME_PARAMETER(Code)



CDATA
final public static String CDATA(Code)



DIRECTORY_CONFIG
final public static String DIRECTORY_CONFIG(Code)



DIRECTORY_DEFAULT
final public static String DIRECTORY_DEFAULT(Code)



DIRECTORY_PARAMETER
final public static String DIRECTORY_PARAMETER(Code)



LUCENE_DOCUMENT_ELEMENT
final public static String LUCENE_DOCUMENT_ELEMENT(Code)



LUCENE_DOCUMENT_URL_ATTRIBUTE
final public static String LUCENE_DOCUMENT_URL_ATTRIBUTE(Code)



LUCENE_ELAPSED_TIME_ATTRIBUTE
final public static String LUCENE_ELAPSED_TIME_ATTRIBUTE(Code)



LUCENE_ELEMENT_ATTR_STORE_VALUE
final public static String LUCENE_ELEMENT_ATTR_STORE_VALUE(Code)



LUCENE_ELEMENT_ATTR_TO_TEXT_ATTRIBUTE
final public static String LUCENE_ELEMENT_ATTR_TO_TEXT_ATTRIBUTE(Code)



LUCENE_QUERY_ANALYZER_ATTRIBUTE
final public static String LUCENE_QUERY_ANALYZER_ATTRIBUTE(Code)



LUCENE_QUERY_CREATE_ATTRIBUTE
final public static String LUCENE_QUERY_CREATE_ATTRIBUTE(Code)



LUCENE_QUERY_DIRECTORY_ATTRIBUTE
final public static String LUCENE_QUERY_DIRECTORY_ATTRIBUTE(Code)



LUCENE_QUERY_ELEMENT
final public static String LUCENE_QUERY_ELEMENT(Code)



LUCENE_QUERY_MAX_FIELD_LENGTH_ATTRIBUTE
final public static String LUCENE_QUERY_MAX_FIELD_LENGTH_ATTRIBUTE(Code)



LUCENE_QUERY_MERGE_FACTOR_ATTRIBUTE
final public static String LUCENE_QUERY_MERGE_FACTOR_ATTRIBUTE(Code)



LUCENE_URI
final public static String LUCENE_URI(Code)



MAX_FIELD_LENGTH_CONFIG
final public static String MAX_FIELD_LENGTH_CONFIG(Code)



MAX_FIELD_LENGTH_DEFAULT
final public static int MAX_FIELD_LENGTH_DEFAULT(Code)



MAX_FIELD_LENGTH_PARAMETER
final public static String MAX_FIELD_LENGTH_PARAMETER(Code)



MERGE_FACTOR_CONFIG
final public static String MERGE_FACTOR_CONFIG(Code)



MERGE_FACTOR_DEFAULT
final public static int MERGE_FACTOR_DEFAULT(Code)



MERGE_FACTOR_PARAMETER
final public static String MERGE_FACTOR_PARAMETER(Code)



workDir
protected File workDir(Code)





Method Detail
characters
public void characters(char[] ch, int start, int length) throws SAXException(Code)



configure
public void configure(Configuration conf) throws ConfigurationException(Code)
Configure the transformer. The configuration parameters are stored as general defaults, which may be over-ridden by parameters specified as parameters in the sitemap pipeline, or by attributes of the query element(s) in the XML input document.



contextualize
public void contextualize(Context context) throws ContextException(Code)
Contextualize this class



endDocument
public void endDocument() throws SAXException(Code)



endElement
public void endElement(String namespaceURI, String localName, String qName) throws SAXException(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.



getKey
public Serializable getKey()(Code)
Generate the unique key. This key must be unique inside the space of this component. The generated key



getValidity
public SourceValidity getValidity()(Code)
Generate the validity object. The generated validity object or null if thecomponent is currently not cacheable.



recycle
public void recycle()(Code)



setup
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters parameters) throws ProcessingException, SAXException, IOException(Code)
Setup the transformer. Called when the pipeline is assembled. The parameters are those specified as child elements of the <map:transform> element in the sitemap. These parameters are optional: If no parameters are specified here then the defaults are supplied by the component configuration. Any parameters specified here may be over-ridden by attributes of the lucene:index element in the input document.



startDocument
public void startDocument() throws SAXException(Code)



startElement
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException(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.




www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.