fr.paris.lutece.portal.service.search
Class PageIndexer

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

public class PageIndexer
extends Object
implements SearchIndexer

Indexer service for pages


Field Summary
protected static IPageService _pageService
           
static String INDEX_TYPE_PAGE
           
static String INDEXER_NAME
           
protected static String PARAMETER_PAGE_ID
           
protected static String PROPERTY_INDEXER_ENABLE
           
protected static String PROPERTY_PAGE_BASE_URL
           
protected static String PROPERTY_SEARCH_PAGE_URL
           
 
Constructor Summary
PageIndexer()
           
 
Method Summary
 String getDescription()
          Returns the indexer service description
protected  org.apache.lucene.document.Document getDocument(Page page, String strUrl)
          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.
 List<org.apache.lucene.document.Document> getDocuments(String nIdDocument)
          Returns a List of lucene documents to add to the index
 List<String> getListType()
          Returns all the types of document the service may index.
 String getName()
          Returns the indexer service name
 String getSpecificSearchAppUrl()
          Returns the search app dedicated to the documents indexed by the service
 String getVersion()
          Returns the indexer service version
 void indexDocuments()
          Index all lucene documents from the plugin, replace List getDocuments( ) method
 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

INDEX_TYPE_PAGE

public static final String INDEX_TYPE_PAGE
See Also:
Constant Field Values

INDEXER_NAME

public static final String INDEXER_NAME
See Also:
Constant Field Values

PROPERTY_PAGE_BASE_URL

protected static final String PROPERTY_PAGE_BASE_URL
See Also:
Constant Field Values

PROPERTY_SEARCH_PAGE_URL

protected static final String PROPERTY_SEARCH_PAGE_URL
See Also:
Constant Field Values

PROPERTY_INDEXER_ENABLE

protected static final String PROPERTY_INDEXER_ENABLE
See Also:
Constant Field Values

PARAMETER_PAGE_ID

protected static final String PARAMETER_PAGE_ID
See Also:
Constant Field Values

_pageService

protected static IPageService _pageService
Constructor Detail

PageIndexer

public PageIndexer()
Method Detail

indexDocuments

public void indexDocuments()
                    throws IOException,
                           InterruptedException,
                           SiteMessageException
Index all lucene documents from the plugin, replace List getDocuments( ) method

Specified by:
indexDocuments in interface SearchIndexer
Throws:
IOException - If an IO error occured
InterruptedException - If a thread error occured
SiteMessageException - occurs when a site message need to be displayed

getDocuments

public List<org.apache.lucene.document.Document> getDocuments(String nIdDocument)
                                                       throws IOException,
                                                              InterruptedException,
                                                              SiteMessageException
Returns a List of lucene documents to add to the index

Specified by:
getDocuments in interface SearchIndexer
Parameters:
nIdDocument - document id
Returns:
A List of lucene documents to add to the index
Throws:
IOException - If an IO error occured
InterruptedException - If a thread error occured
SiteMessageException - occurs when a site message need to be displayed

getName

public String getName()
Returns the indexer service name

Specified by:
getName in interface SearchIndexer
Returns:
the indexer service name

getVersion

public String getVersion()
Returns the indexer service version

Specified by:
getVersion in interface SearchIndexer
Returns:
the indexer service version

getDescription

public String getDescription()
Returns the indexer service description

Specified by:
getDescription in interface SearchIndexer
Returns:
the indexer service description

isEnable

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

Specified by:
isEnable in interface SearchIndexer
Returns:
true if enable, otherwise false

getDocument

protected org.apache.lucene.document.Document getDocument(Page page,
                                                          String strUrl)
                                                   throws IOException,
                                                          InterruptedException,
                                                          SiteMessageException
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:
strUrl - The base URL for documents
page - the page to index
Returns:
the built Document
Throws:
IOException - The IO Exception
InterruptedException - The InterruptedException
SiteMessageException - occurs when a site message need to be displayed

getListType

public List<String> getListType()
Returns all the types of document the service may index. (See SearchItem.getType())

Specified by:
getListType in interface SearchIndexer
Returns:
The list

getSpecificSearchAppUrl

public String getSpecificSearchAppUrl()
Returns the search app dedicated to the documents indexed by the service

Specified by:
getSpecificSearchAppUrl in interface SearchIndexer
Returns:
the url of the app page


Copyright © 2014 Mairie de Paris. All Rights Reserved.