01: /*
02: * Copyright 2004-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.compass.core.engine;
18:
19: import org.compass.core.CompassHighlighter;
20: import org.compass.core.Resource;
21:
22: /**
23: *
24: * @author kimchy
25: *
26: */
27: public interface SearchEngineHighlighter {
28:
29: SearchEngineHighlighter clear();
30:
31: void close() throws SearchEngineException;
32:
33: SearchEngineHighlighter setHighlighter(String highlighterName)
34: throws SearchEngineException;
35:
36: SearchEngineHighlighter setAnalyzer(String analyzerName)
37: throws SearchEngineException;
38:
39: SearchEngineHighlighter setAnalyzer(Resource resource)
40: throws SearchEngineException;
41:
42: SearchEngineHighlighter setSeparator(String separator)
43: throws SearchEngineException;
44:
45: SearchEngineHighlighter setMaxNumFragments(int maxNumFragments)
46: throws SearchEngineException;
47:
48: SearchEngineHighlighter setMaxBytesToAnalyze(int maxBytesToAnalyze)
49: throws SearchEngineException;
50:
51: SearchEngineHighlighter setTextTokenizer(
52: CompassHighlighter.TextTokenizer textTokenizer)
53: throws SearchEngineException;
54:
55: String fragment(Resource resource, String propertyName)
56: throws SearchEngineException;
57:
58: String fragment(Resource resource, String propertyName, String text)
59: throws SearchEngineException;
60:
61: String[] fragments(Resource resource, String propertyName)
62: throws SearchEngineException;
63:
64: String[] fragments(Resource resource, String propertyName,
65: String text) throws SearchEngineException;
66:
67: String fragmentsWithSeparator(Resource resource, String propertyName)
68: throws SearchEngineException;
69:
70: String fragmentsWithSeparator(Resource resource,
71: String propertyName, String text)
72: throws SearchEngineException;
73:
74: String[] multiResourceFragment(Resource resource,
75: String propertyName) throws SearchEngineException;
76:
77: String[] multiResourceFragment(Resource resource,
78: String propertyName, String[] texts)
79: throws SearchEngineException;
80:
81: String multiResourceFragmentWithSeparator(Resource resource,
82: String propertyName) throws SearchEngineException;
83:
84: String multiResourceFragmentWithSeparator(Resource resource,
85: String propertyName, String[] texts)
86: throws SearchEngineException;
87: }
|