Java Doc for LuceneIndexTransformer2.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.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


Field Summary
final public static  intDELETE_PROCESS
    
final public static  intDELETING_PROCESS
    
final public static  StringDIRECTORY_DEFAULT
    
final public static  intINDEX_PROCESS
    
final public static  intIN_DOCUMENT_PROCESS
    
final public static  intIN_FIELD_PROCESS
    
final public static  StringLUCENE_DELETING_ELEMENT
    
final public static  StringLUCENE_DOCUMENT_ELEMENT
    
final public static  StringLUCENE_DOCUMENT_UID_ATTRIBUTE
    
final public static  StringLUCENE_FIELD_BOOST_ATTRIBUTE
    
final public static  StringLUCENE_FIELD_ELEMENT
    
final public static  StringLUCENE_FIELD_NAME_ATTRIBUTE
    
final public static  StringLUCENE_INDEXING_ANALYZER_ATTRIBUTE
    
final public static  StringLUCENE_INDEXING_CREATE_ATTRIBUTE
    
final public static  StringLUCENE_INDEXING_ELEMENT
    
final public static  StringLUCENE_INDEXING_INDEXID_ATTRIBUTE
    
final public static  StringLUCENE_INDEXING_MERGE_FACTOR_ATTRIBUTE
    
final public static  StringLUCENE_PREXIF
    
final public static  StringLUCENE_URI
    
final public static  intNO_PROCESSING
    


Method Summary
protected  booleancanIndex()
    
public  voidcharacters(char[] ch, int start, int length)
    
 voidcloseIndexer()
    
public  voidconfigure(Configuration config)
    
public  voidendDocument()
    
public  voidendElement(String namespaceURI, String localName, String qName)
    
public  voidendPrefixMapping(String prefix)
     End the scope of a prefix-URI mapping.
protected  StringgetExceptionMessage(Exception ex)
    
 voidhandleError(String message, Exception ex)
    
 voidhandleError(Exception ex)
    
 voidhandleError(String msg)
    
public  voidrecycle()
    
public  voidservice(ServiceManager manager)
    
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
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)



LUCENE_PREXIF
final public static String LUCENE_PREXIF(Code)



LUCENE_URI
final public static String LUCENE_URI(Code)



NO_PROCESSING
final public static int NO_PROCESSING(Code)





Method Detail
canIndex
protected boolean canIndex()(Code)



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



closeIndexer
void closeIndexer() throws SAXException(Code)
Close the indexer
throws:
  SAXException -



configure
public void configure(Configuration config) throws ConfigurationException(Code)



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.



getExceptionMessage
protected String getExceptionMessage(Exception ex) throws SAXException(Code)



handleError
void handleError(String message, Exception ex) throws SAXException(Code)



handleError
void handleError(Exception ex) throws SAXException(Code)



handleError
void handleError(String msg) throws SAXException(Code)
Handle Exception or Error
Parameters:
  msg -
Parameters:
  ex -
throws:
  SAXException -



recycle
public void recycle()(Code)



service
public void service(ServiceManager manager) throws ServiceException(Code)



setup
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters parameters) throws ProcessingException, SAXException, IOException(Code)
Setup the transformer.



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.