1 /***
2 Copyright (C) 2005 The Java Community
3
4 This program is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free Software
6 Foundation; either version 2 of the License, or (at your option) any later
7 version.
8
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License along with
14 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15 Place, Suite 330, Boston, MA 02111-1307 USA.
16 */
17 package org.bejug.javacareers.jobs.service;
18
19 import java.util.List;
20
21 import org.bejug.javacareers.jobs.search.lucene.PdfException;
22
23 /***
24 * Utility service to enable searching through PDF files and getting surrounding context
25 * of matches.
26 *
27 * @author Bavo Bruylandt (Last modified by $Author: schauwvliege $)
28 * @version $Revision: 1.3 $ - $Date: 2005/09/13 08:11:17 $
29 */
30 public interface LucenePdfService {
31
32 /***
33 * Adds a PDF file to the Lucene search index.
34 * Can take a few seconds to complete.
35 *
36 * @param path Absolute path to the PDF file
37 * @param user the user who is indexing.
38 * @throws PdfException When Lucene can not index the file
39 */
40 void addToIndex(String path, String user) throws PdfException;
41
42 /***
43 * Removes an indexed PDF file from search index.
44 *
45 * @param user Name of user to remove
46 * @throws PdfException When Lucene can not delete the file from index
47 */
48 void removeFromIndex(String user) throws PdfException;
49
50 /***
51 * Removes an indexed PDF file from search index.
52 *
53 * @param startTag Tag to start the highlighted term with
54 * @param endTag Tag to end the highlighted term with
55 */
56 void setHighlightTags(String startTag, String endTag);
57
58 /***
59 * Searches the complete Lucene index for results matching the query.
60 *
61 * @param query A logical search query. Accepts wildcards, ranges and
62 * fuzzy search.
63 * @return A List of SearchResults containg all matches
64 * @throws PdfException When Lucene can not search the index
65 */
66 List getSearchResultList(String query) throws PdfException;
67
68 /***
69 * Searches the complete Lucene index for results matching the query.
70 *
71 * @param query A logical search query. Accepts wildcards, ranges and fuzzy
72 * search.
73 * @param contextLength The length of surrounding context to return
74 * @return A List of SearchResults containg all matches
75 * @throws PdfException When Lucene can not search the index
76 */
77 List getSearchResultList(String query, int contextLength)
78 throws PdfException;
79 }
80
81 /***
82 * $Log: LucenePdfService.java,v $
83 * Revision 1.3 2005/09/13 08:11:17 schauwvliege
84 * organize imports
85 *
86 * Revision 1.2 2005/08/31 09:53:40 bavo_jcs
87 * Lucene delete fix
88 *
89 * Revision 1.1 2005/08/26 07:58:31 ge0ffrey
90 * split up the sources in service, serviceimpl and webclient
91 *
92 * Revision 1.5 2005/08/10 09:04:49 bavo_jcs
93 * Optimized imports according to checkstyle
94 *
95 * Revision 1.4 2005/08/08 09:38:21 bme_jcs
96 * resolved checkstyle errors
97 *
98 * Revision 1.3 2005/07/12 10:42:39 bavo_jcs
99 * PDF Ajax integration, added user info
100 *
101 * Revision 1.2 2005/06/09 08:18:52 bejug_cc
102 * Fix initial import
103 *
104 * Revision 1.4 2005/06/07 14:38:48 bbr
105 * Lucene highlightterms added
106 *
107 * Revision 1.3 2005/05/25 13:13:48 bbr
108 * lucene bean
109 *
110 * Revision 1.2 2005/05/24 07:58:21 bbr
111 * fixed lucene refactoring errors
112 *
113 * Revision 1.1 2005/05/23 17:17:25 sja
114 * Moved to org.bejug.javacareers.jobs.service package.
115 *
116 * Revision 1.1 2005/05/23 17:04:57 sja
117 * Moved to org.bejug.javacareers.feeder package.
118 *
119 * Revision 1.3 2005/05/23 15:42:00 bbr
120 * added weight to lucene
121 *
122 * Revision 1.2 2005/05/23 15:33:12 bbr
123 * added weight to lucene
124 *
125 * Revision 1.1 2005/05/23 08:46:33 PSONG09
126 * added feeder source files to project
127 *
128 * Revision 1.3 2005/05/23 07:14:24 stephan_janssen
129 * Code cleanup.
130 *
131 */