Java Doc for SimpleLuceneCocoonSearcherImpl.java in  » Content-Management-System » apache-lenya-2.0 » org » apache » cocoon » components » search » 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.components.search 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.cocoon.components.search.SimpleLuceneCocoonSearcherImpl

SimpleLuceneCocoonSearcherImpl
public class SimpleLuceneCocoonSearcherImpl extends AbstractLogEnabled implements LuceneCocoonSearcher,Configurable,Serviceable,Disposable,Recyclable(Code)
This class provides searching via lucene.

In order to do searching you need a lucene Directory where the lucene generated index resides. Moreover you must know the lucene Analyzer which has been used for indexing, and which will be used for searching.

Knowing this you can may start searching having a query which is parsable by an QueryParser, and having the name of the default field to use in searching.

This class returns an Hit object as its search result.


author:
   Bernhard Huber
version:
   CVS $Id: SimpleLuceneCocoonSearcherImpl.java 433543 2006-08-22 06:22:54Z crossley $

Inner Class :static class IndexReaderCache

Field Summary
final protected static  StringANALYZER_CLASSNAME_CONFIG
     Configuration element name of lucene's Analyzer class.
final protected static  StringANALYZER_CLASSNAME_DEFAULT
     Configuration element default value of lucene's Analyzer class.
final protected static  StringDEFAULT_QUERY_CONFIG
     Configuration element name of default-query.
final protected static  StringDEFAULT_QUERY_DEFAULT
     Configuration element default value of default-query.
final protected static  StringDEFAULT_SEARCH_FIELD_CONFIG
     Configuration element name of default search field.
final protected static  StringDEFAULT_SEARCH_FIELD_DEFAULT
     Configuration element default value of lucene's default search field.
final protected static  StringDIRECTORY_CONFIG
     Configuration element name of lucene's default filesystem default directory.
final protected static  StringDIRECTORY_DEFAULT
     Configuration element default value of filesystem default directory.
final protected static  StringQUERYPARSER_CLASSNAME_CONFIG
     Configuration element name of query parser class name.
final protected static  StringQUERYPARSER_CLASSNAME_DEFAULT
     Configuration element default value of queryparser-classname.
protected  ServiceManagermanager
    


Method Summary
public  voidconfigure(Configuration conf)
    
public  voiddispose()
     Dispose this component, releasing IndexSearcher, and IndexReaderCache.
public  AnalyzergetAnalyzer()
     get the analyzer.
public  IndexReadergetReader()
     Get an IndexReader.
public  voidrecycle()
     Recycle this component, releasing IndexSearcher, and IndexReaderCache.
public  Hitssearch(String query_string, String default_field)
     Search lucene index.
public  Hitssearch(Query query)
     Search lucene index.
public  voidservice(ServiceManager manager)
     Set the current ServiceManager instance used by this Serviceable.
public  voidsetAnalyzer(Analyzer analyzer)
     set an analyzer, overriding the analyzerClassnameDefault.
public  voidsetDirectory(Directory directory)
    

Field Detail
ANALYZER_CLASSNAME_CONFIG
final protected static String ANALYZER_CLASSNAME_CONFIG(Code)
Configuration element name of lucene's Analyzer class.

Its value is analyzer-classname.




ANALYZER_CLASSNAME_DEFAULT
final protected static String ANALYZER_CLASSNAME_DEFAULT(Code)
Configuration element default value of lucene's Analyzer class.

Its value is, org.apache.lucene.analysis.standard.StandardAnalyzer.




DEFAULT_QUERY_CONFIG
final protected static String DEFAULT_QUERY_CONFIG(Code)
Configuration element name of default-query.

Its value is default-query.




DEFAULT_QUERY_DEFAULT
final protected static String DEFAULT_QUERY_DEFAULT(Code)
Configuration element default value of default-query.

Its value is null.




DEFAULT_SEARCH_FIELD_CONFIG
final protected static String DEFAULT_SEARCH_FIELD_CONFIG(Code)
Configuration element name of default search field.

Its value is default-seach-field.




DEFAULT_SEARCH_FIELD_DEFAULT
final protected static String DEFAULT_SEARCH_FIELD_DEFAULT(Code)
Configuration element default value of lucene's default search field.

Its value is body.




DIRECTORY_CONFIG
final protected static String DIRECTORY_CONFIG(Code)
Configuration element name of lucene's default filesystem default directory.

Its value is directory.




DIRECTORY_DEFAULT
final protected static String DIRECTORY_DEFAULT(Code)
Configuration element default value of filesystem default directory.

Its value is null.




QUERYPARSER_CLASSNAME_CONFIG
final protected static String QUERYPARSER_CLASSNAME_CONFIG(Code)
Configuration element name of query parser class name.

Its value is queryparser-classname.




QUERYPARSER_CLASSNAME_DEFAULT
final protected static String QUERYPARSER_CLASSNAME_DEFAULT(Code)
Configuration element default value of queryparser-classname.

Its value is org.apache.lucene.queryParser.QueryParser.




manager
protected ServiceManager manager(Code)
The service manager instance





Method Detail
configure
public void configure(Configuration conf) throws ConfigurationException(Code)
configure this component
Parameters:
  conf - of this component
exception:
  ConfigurationException - is thrown iff configuration of this component fails



dispose
public void dispose()(Code)
Dispose this component, releasing IndexSearcher, and IndexReaderCache.



getAnalyzer
public Analyzer getAnalyzer()(Code)
get the analyzer.



getReader
public IndexReader getReader() throws IOException(Code)
Get an IndexReader.

As an IndexReader might be cached, it is check if the indexReader is still valid.

IndexReader an up to date indexReader
exception:
  IOException - is thrown iff it's impossible to create an IndexReader



recycle
public void recycle()(Code)
Recycle this component, releasing IndexSearcher, and IndexReaderCache.



search
public Hits search(String query_string, String default_field) throws ProcessingException(Code)
Search lucene index.
Parameters:
  query_string - is lucene's query string
Parameters:
  default_field - the lucene field to run the query lucene Hits
exception:
  ProcessingException - iff its not possible do run the query



search
public Hits search(Query query) throws ProcessingException(Code)
Search lucene index. This method is designed to be used by other components, or Flowscripts
Parameters:
  query - the lucene Query lucene Hits
exception:
  ProcessingException - if its not possible do run the query



service
public void service(ServiceManager manager) throws ServiceException(Code)
Set the current ServiceManager instance used by this Serviceable.
Parameters:
  manager - manager of this component
exception:
  ServiceException - is never thrown



setAnalyzer
public void setAnalyzer(Analyzer analyzer)(Code)
set an analyzer, overriding the analyzerClassnameDefault.
Parameters:
  analyzer - The new analyzer value



setDirectory
public void setDirectory(Directory directory)(Code)
Sets the directory attribute of the SimpleLuceneCocoonSearcherImpl object
Parameters:
  directory - The new directory value



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