fr.paris.lutece.plugins.document.service.search
Class DocumentIndexer

java.lang.Object
  extended by fr.paris.lutece.plugins.document.service.search.DocumentIndexer
All Implemented Interfaces:
fr.paris.lutece.portal.service.search.SearchIndexer

public class DocumentIndexer
extends java.lang.Object
implements fr.paris.lutece.portal.service.search.SearchIndexer

Document Indexer


Field Summary
static java.lang.String INDEXER_NAME
           
static java.lang.String SHORT_NAME
           
 
Constructor Summary
DocumentIndexer()
           
 
Method Summary
 java.lang.String getDescription()
          Returns the indexer service description
static org.apache.lucene.document.Document getDocument(Document document, java.lang.String strUrl, java.lang.String strRole, java.lang.String strPortletDocumentId)
          Builds a document which will be used by Lucene during the indexing of the pages of the site with the following fields : summary, uid, url, contents, title and description.
 java.util.List<org.apache.lucene.document.Document> getDocuments(java.lang.String strIdDocument)
          Returns a collection of lucene documents with the same id
 java.lang.String getName()
          Returns the indexer service name
 java.lang.String getVersion()
          Returns the indexer service version
 void indexDocuments()
          index all lucene documents
 boolean isEnable()
          Tells whether the service is enable or not
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INDEXER_NAME

public static final java.lang.String INDEXER_NAME
See Also:
Constant Field Values

SHORT_NAME

public static final java.lang.String SHORT_NAME
See Also:
Constant Field Values
Constructor Detail

DocumentIndexer

public DocumentIndexer()
Method Detail

indexDocuments

public void indexDocuments()
                    throws java.io.IOException,
                           java.lang.InterruptedException
index all lucene documents

Specified by:
indexDocuments in interface fr.paris.lutece.portal.service.search.SearchIndexer
Throws:
java.io.IOException - i/o exception
java.lang.InterruptedException - interrupted exception

getDocuments

public java.util.List<org.apache.lucene.document.Document> getDocuments(java.lang.String strIdDocument)
                                                                 throws java.io.IOException,
                                                                        java.lang.InterruptedException
Returns a collection of lucene documents with the same id

Specified by:
getDocuments in interface fr.paris.lutece.portal.service.search.SearchIndexer
Parameters:
nIdDocument - the document id
Returns:
lucene documents
Throws:
IOexception - i/o exception
java.lang.InterruptedException - interrupted exception
java.io.IOException

getName

public java.lang.String getName()
Returns the indexer service name

Specified by:
getName in interface fr.paris.lutece.portal.service.search.SearchIndexer
Returns:
the indexer service name

getVersion

public java.lang.String getVersion()
Returns the indexer service version

Specified by:
getVersion in interface fr.paris.lutece.portal.service.search.SearchIndexer
Returns:
The indexer service version

getDescription

public java.lang.String getDescription()
Returns the indexer service description

Specified by:
getDescription in interface fr.paris.lutece.portal.service.search.SearchIndexer
Returns:
The indexer service description

isEnable

public boolean isEnable()
Tells whether the service is enable or not

Specified by:
isEnable in interface fr.paris.lutece.portal.service.search.SearchIndexer
Returns:
true if enable, otherwise false

getDocument

public static org.apache.lucene.document.Document getDocument(Document document,
                                                              java.lang.String strUrl,
                                                              java.lang.String strRole,
                                                              java.lang.String strPortletDocumentId)
                                                       throws java.io.IOException,
                                                              java.lang.InterruptedException
Builds a document which will be used by Lucene during the indexing of the pages of the site with the following fields : summary, uid, url, contents, title and description.

Parameters:
document - the document to index
strUrl - the url of the documents
strRole - the lutece role of the page associate to the document
strPortletDocumentId - the document id concatened to the id portlet with a & in the middle
Returns:
the built Document
Throws:
java.io.IOException - The IO Exception
java.lang.InterruptedException - The InterruptedException


Copyright © 2010 Mairie de Paris. All Rights Reserved.