org.bejug.javacareers.jobs.service
Class LucenePdfServiceImpl

java.lang.Object
  extended byorg.bejug.javacareers.jobs.service.LucenePdfServiceImpl
All Implemented Interfaces:
LucenePdfService

public class LucenePdfServiceImpl
extends java.lang.Object
implements LucenePdfService

Implementation of LucenePdfService.

Version:
$Revision: 1.1 $ - $Date: 2005/08/26 07:58:31 $
Author:
Bavo Bruylandt (Last modified by $Author: ge0ffrey $)

Constructor Summary
LucenePdfServiceImpl()
          Constructor.
 
Method Summary
 void addToIndex(java.lang.String filepath, java.lang.String user)
          Adds a PDF file to the Lucene search index. Can take a few seconds to complete.
 ContextSearcher getContextSearcher()
           
 java.lang.String getLuceneIndexPath()
           
 PdfIndexer getPdfIndexer()
           
 java.util.List getSearchResultList(java.lang.String query)
          Searches the complete Lucene index for results matching the query.
 java.util.List getSearchResultList(java.lang.String query, int contextLength)
          Searches the complete Lucene index for results matching the query.
 void removeFromIndex(java.lang.String file)
          Removes an indexed PDF file from search index.
 void setContextSearcher(ContextSearcher contextSearcher)
           
 void setHighlightTags(java.lang.String startTag, java.lang.String endTag)
          Removes an indexed PDF file from search index.
 void setLuceneIndexPath(java.lang.String luceneIndexPath)
           
 void setPdfIndexer(PdfIndexer pdfIndexer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LucenePdfServiceImpl

public LucenePdfServiceImpl()
Constructor.

Method Detail

addToIndex

public void addToIndex(java.lang.String filepath,
                       java.lang.String user)
                throws PdfException
Adds a PDF file to the Lucene search index. Can take a few seconds to complete.

Specified by:
addToIndex in interface LucenePdfService
Parameters:
filepath - Absolute path to the PDF file
user - the user who is indexing.
Throws:
PdfException - When Lucene can not index the file

removeFromIndex

public void removeFromIndex(java.lang.String file)
                     throws PdfException
Removes an indexed PDF file from search index.

Specified by:
removeFromIndex in interface LucenePdfService
Parameters:
file - Name of user to remove
Throws:
PdfException - When Lucene can not delete the file from index

setHighlightTags

public void setHighlightTags(java.lang.String startTag,
                             java.lang.String endTag)
Removes an indexed PDF file from search index.

Specified by:
setHighlightTags in interface LucenePdfService
Parameters:
startTag - Tag to start the highlighted term with
endTag - Tag to end the highlighted term with

getSearchResultList

public java.util.List getSearchResultList(java.lang.String query)
                                   throws PdfException
Searches the complete Lucene index for results matching the query.

Specified by:
getSearchResultList in interface LucenePdfService
Parameters:
query - A logical search query. Accepts wildcards, ranges and fuzzy search.
Returns:
A List of SearchResults containg all matches
Throws:
PdfException - When Lucene can not search the index

getSearchResultList

public java.util.List getSearchResultList(java.lang.String query,
                                          int contextLength)
                                   throws PdfException
Searches the complete Lucene index for results matching the query.

Specified by:
getSearchResultList in interface LucenePdfService
Parameters:
query - A logical search query. Accepts wildcards, ranges and fuzzy search.
contextLength - The length of surrounding context to return
Returns:
A List of SearchResults containg all matches
Throws:
PdfException - When Lucene can not search the index

getPdfIndexer

public PdfIndexer getPdfIndexer()
                         throws PdfException
Returns:
pdfIndexer
Throws:
PdfException - if an error.

setPdfIndexer

public void setPdfIndexer(PdfIndexer pdfIndexer)
Parameters:
pdfIndexer - PdfIndexer.

getContextSearcher

public ContextSearcher getContextSearcher()
Returns:
contextSearcher.

setContextSearcher

public void setContextSearcher(ContextSearcher contextSearcher)
Parameters:
contextSearcher - ContextSearcher.

getLuceneIndexPath

public java.lang.String getLuceneIndexPath()
Returns:
luceneIndexPath

setLuceneIndexPath

public void setLuceneIndexPath(java.lang.String luceneIndexPath)
Parameters:
luceneIndexPath - String


Copyright © 2005-2006 BeJUG. All Rights Reserved.