|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--com.swfit.core.search.XHTMLPublishedObjectIndex
A XHTMLPublishedObjectIndex is a class that instantiates the
necessary resources needed to call the Lucene IndexWriter.
An important point to remember, is that the Analyzer used to store the data,
must be the same Analyzer used to search the data. For that reason any
XHTMLPublishedObjectIndex created will be stored in a Hashtable.
Jakarta Lucene is a high-performance, full-featured text search engine written entirely in Java. It is a technology suitable for nearly any application that requires full-text search, especially cross-platform. Jakarta Lucene is an open source project available for free download from Apache Jakarta:
http://jakarta.apache.org/lucene/docs/index.html
All in all this is my effort to understand the underlying structure of Lucene. I assume that there are all sorts of smart things one can do to optimize the searching processes, but I see from the FAQs and tutorials that it is recommended to be on the safe side (better safe than clever). And there is a million things I need to figure out first.
| Field Summary | |
static java.lang.String |
ANALYZER_STRING
|
static java.lang.String[] |
ANALYZER_STRINGS
|
static org.apache.lucene.analysis.Analyzer[] |
ANALYZERS
Tools for setting an Analyzer from a parameter. |
static org.apache.lucene.index.Term |
AUTHOR_TERM
Terms for storing, sorting, retrieving and displaying XHTMLPublishObjects |
static org.apache.lucene.index.Term |
CATEGORY_TERM
Terms for storing, sorting, retrieving and displaying XHTMLPublishObjects |
static org.apache.lucene.index.Term |
CREATED_TERM
Terms for storing, sorting, retrieving and displaying XHTMLPublishObjects |
static int |
DEFAULT_ANALYZER
|
static org.apache.lucene.index.Term |
DISPLAYTEXT_TERM
Terms for storing, sorting, retrieving and displaying XHTMLPublishObjects |
static org.apache.lucene.index.Term |
FCREATED_TERM
Terms for storing, sorting, retrieving and displaying XHTMLPublishObjects |
static org.apache.lucene.index.Term |
FILE_TERM
Terms for storing, sorting, retrieving and displaying XHTMLPublishObjects |
static org.apache.lucene.index.Term |
FMODIFIED_TERM
Terms for storing, sorting, retrieving and displaying XHTMLPublishObjects |
static org.apache.lucene.index.Term |
ID_TERM
Terms for storing, sorting, retrieving and displaying XHTMLPublishObjects |
static org.apache.lucene.index.Term |
LINK_TERM
Terms for storing, sorting, retrieving and displaying XHTMLPublishObjects |
static org.apache.lucene.index.Term |
LINKTEXT_TERM
Terms for storing, sorting, retrieving and displaying XHTMLPublishObjects |
static org.apache.lucene.index.Term |
MODIFIED_TERM
Terms for storing, sorting, retrieving and displaying XHTMLPublishObjects |
static int |
SCANDINAVIAN_ANALYZER
|
static org.apache.lucene.index.Term |
SEARCHTEXT_TERM
Terms for storing, sorting, retrieving and displaying XHTMLPublishObjects |
static int |
STANDARD_ANALYZER
|
static org.apache.lucene.index.Term |
TITLE_TERM
Terms for storing, sorting, retrieving and displaying XHTMLPublishObjects |
| Method Summary | |
org.apache.lucene.analysis.Analyzer |
analyzer()
|
static org.apache.lucene.analysis.Analyzer |
analyzer(int analyzer)
|
static int |
analyzer(java.lang.String analyzer)
|
void |
closeReader()
Close a reader to free resources and enable a writer to write new segments. |
void |
closeWriter()
If the writer has the index locked for write, we need to close it to enable the reader to delete docs. |
void |
freeSearcher()
Tells this XHTMLPublishedObjectIndex that it is OK to hand out the searcher again. |
static XHTMLPublishedObjectIndex |
getIndexer(java.io.File index_directory,
org.apache.lucene.analysis.Analyzer analyzer)
Build a XHTMLPublishedObjectIndex with the directory to store the Lucene index in, a parameter code for the Analyzer to use and a set of standard file types. |
static XHTMLPublishedObjectIndex |
getIndexer(java.lang.String index_directory)
Build a XHTMLPublishedObjectIndex with the directory to store the Lucene index in. |
static XHTMLPublishedObjectIndex |
getIndexer(java.lang.String index_directory,
int analyzer)
Build a XHTMLPublishedObjectIndex with the directory to store the Lucene index in and a parameter code for the Analyzer to use. |
org.apache.lucene.search.Searcher |
getSearcher()
Check if the resources are unused, create a searcher if necessary, and hand it out. |
static java.lang.String |
id(java.lang.String publish_sub_folder,
java.lang.String xhtml_object_type,
long creation_date)
|
void |
indexXHTMLPublishedObject(XHTMLPublishedObjectList xpobj_list,
XHTMLPublishedObject xpobj,
boolean add)
|
void |
indexXHTMLPublishedObjects(XHTMLPublishedObjectList xpobj_list,
XHTMLPublishedObject[] xpobjs,
boolean add)
|
void |
outFileCheck()
Go through all the outfiles and check that they actually exist. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final org.apache.lucene.analysis.Analyzer[] ANALYZERS
An Analyzer should have no state. From the Official Lucene FAQ:
"An Analyzer object is merely a factory for TokenStream objects and in typical implementations it does not have any state so you can create one during program initialization and keep it in a static variable."
The following are tools for configuring the analyzer though the web.xml file.
public static final int STANDARD_ANALYZER
public static final int SCANDINAVIAN_ANALYZER
public static final int DEFAULT_ANALYZER
public static final java.lang.String ANALYZER_STRING
public static final java.lang.String[] ANALYZER_STRINGS
public static final org.apache.lucene.index.Term TITLE_TERM
public static final org.apache.lucene.index.Term AUTHOR_TERM
public static final org.apache.lucene.index.Term CATEGORY_TERM
public static final org.apache.lucene.index.Term LINK_TERM
public static final org.apache.lucene.index.Term LINKTEXT_TERM
public static final org.apache.lucene.index.Term CREATED_TERM
public static final org.apache.lucene.index.Term MODIFIED_TERM
public static final org.apache.lucene.index.Term FCREATED_TERM
public static final org.apache.lucene.index.Term FMODIFIED_TERM
public static final org.apache.lucene.index.Term FILE_TERM
public static final org.apache.lucene.index.Term DISPLAYTEXT_TERM
public static final org.apache.lucene.index.Term SEARCHTEXT_TERM
public static final org.apache.lucene.index.Term ID_TERM
| Method Detail |
public final org.apache.lucene.analysis.Analyzer analyzer()
public static XHTMLPublishedObjectIndex getIndexer(java.lang.String index_directory)
throws java.io.IOException
XHTMLPublishedObjectIndex with the directory to store the Lucene index in.
Indexes the default set of file types, and uses the StandardAnalyzer.
The method is static, so that all requests for a XHTMLPublishedObjectIndex first
checks if one exist for that directory, before a new instance is created.
index_directory - the File to store the index in.XHTMLPublishedObjectIndex corresponding to the given directory.
public static XHTMLPublishedObjectIndex getIndexer(java.lang.String index_directory,
int analyzer)
throws java.io.IOException
Analyzer to use. Will index the standard file types.
The method is static, so that all requests for a XHTMLPublishedObjectIndex first
checks if one exist for that directory.
index_directory - the File to store the index in.analyzer_type - the Analyzer type as a String.XHTMLPublishedObjectIndex corresponding to the given directory.
public static final XHTMLPublishedObjectIndex getIndexer(java.io.File index_directory,
org.apache.lucene.analysis.Analyzer analyzer)
throws java.io.IOException
Analyzer to use and a set of standard file types.
The method is static, so that all requests for a XHTMLPublishedObjectIndex first
checks if one exist for that directory.
index_directory - the File to store the index in.analyzer - the Analyzer to use while indexing.file_types - the array of Strings denoting the file types to index.XHTMLPublishedObjectIndex corresponding to the given directory.public static final org.apache.lucene.analysis.Analyzer analyzer(int analyzer)
public static final int analyzer(java.lang.String analyzer)
public final org.apache.lucene.search.Searcher getSearcher()
throws java.io.IOException,
java.lang.InterruptedException
Searcher corresponding to this index.public final void freeSearcher()
public final void closeReader()
throws java.io.IOException
public final void closeWriter()
throws java.io.IOException
public static final java.lang.String id(java.lang.String publish_sub_folder,
java.lang.String xhtml_object_type,
long creation_date)
public final void indexXHTMLPublishedObject(XHTMLPublishedObjectList xpobj_list,
XHTMLPublishedObject xpobj,
boolean add)
throws java.lang.InterruptedException,
java.io.IOException
public final void indexXHTMLPublishedObjects(XHTMLPublishedObjectList xpobj_list,
XHTMLPublishedObject[] xpobjs,
boolean add)
throws java.lang.InterruptedException,
java.io.IOException
public final void outFileCheck()
throws java.lang.InterruptedException,
java.io.IOException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||