01: /*
02: Very Quick Wiki - WikiWikiWeb clone
03: Copyright (C) 2001-2002 Gareth Cronin
04:
05: This program is free software; you can redistribute it and/or modify
06: it under the terms of the latest version of the GNU Lesser General
07: Public License as published by the Free Software Foundation;
08:
09: This program is distributed in the hope that it will be useful,
10: but WITHOUT ANY WARRANTY; without even the implied warranty of
11: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: GNU Lesser General Public License for more details.
13:
14: You should have received a copy of the GNU Lesser General Public License
15: along with this program (gpl.txt); if not, write to the Free Software
16: Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17: */
18: package vqwiki;
19:
20: import java.io.IOException;
21: import java.util.Collection;
22:
23: public interface SearchEngine {
24:
25: /**
26: * Index the given text for the search engine database.
27: */
28: public void indexText(String virtualWiki, String topic, String text)
29: throws IOException;
30:
31: /**
32: * Should be called by a monitor thread at regular intervals, rebuilds the
33: * entire seach index to account for removed items. Due to the additive rather
34: * than subtractive nature of a Wiki, it probably only needs to be called once
35: * or twice a day
36: */
37: public void refreshIndex() throws Exception;
38:
39: /**
40: * Find topics that contain the given term
41: */
42: public Collection find(String virtualWiki, String text,
43: boolean doTextBeforeAfterParse) throws Exception;
44:
45: /**
46: * Find topics that contain the given term
47: */
48: public Collection findLinkedTo(String virtualWiki, String topicName)
49: throws Exception;
50:
51: /**
52: * Find topics that contain any of the space delimited terms
53: */
54: public Collection findMultiple(String virtualWiki, String text,
55: boolean fuzzy) throws Exception;
56:
57: /**
58: * Get all topics
59: */
60: public Collection getAllTopicNames(String virtualWiki)
61: throws Exception;
62:
63: /**
64: * Get the path, which holds all index files
65: */
66: public String getSearchIndexPath(String vrtualWiki);
67: }
|