org.bejug.javacareers.jobs.service
Interface LucenePdfService

All Known Implementing Classes:
LucenePdfServiceImpl

public interface LucenePdfService

Utility service to enable searching through PDF files and getting surrounding context of matches.

Version:
$Revision: 1.3 $ - $Date: 2005/09/13 08:11:17 $
Author:
Bavo Bruylandt (Last modified by $Author: schauwvliege $)

Method Summary
 void addToIndex(java.lang.String path, java.lang.String user)
          Adds a PDF file to the Lucene search index.
 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 user)
          Removes an indexed PDF file from search index.
 void setHighlightTags(java.lang.String startTag, java.lang.String endTag)
          Removes an indexed PDF file from search index.
 

Method Detail

addToIndex

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

Parameters:
path - 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 user)
                     throws PdfException
Removes an indexed PDF file from search index.

Parameters:
user - 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.

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.

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.

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


Copyright © 2005-2006 BeJUG. All Rights Reserved.