01: /*
02: * Copyright 2004 Outerthought bvba and Schaubroeck nv
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: package org.outerj.daisy.ftindex;
17:
18: import java.util.List;
19:
20: import org.apache.xmlbeans.XmlObject;
21: import org.outerj.daisy.repository.VariantKey;
22:
23: public interface Hits {
24: /**
25: * Returns the VariantKey for the nth matching document.
26: */
27: VariantKey getVariantKey(int n);
28:
29: /**
30: * Returns the list of all variant keys, sorted by score (descending).
31: */
32: List<VariantKey> getAllVariantKeys();
33:
34: /**
35: * Returns the total number of hits available in this set.
36: */
37: int length();
38:
39: /**
40: * Returns the score for the nth document in this set.
41: */
42: float score(int n);
43:
44: /**
45: * Returns the score for a document in the result set with is the given VariantKey.
46: */
47: float score(VariantKey key);
48:
49: /**
50: * Returns a contextualized text fragment based on the sought after terms
51: */
52: XmlObject contextFragments(int n, int fragmentAmount)
53: throws Exception;
54:
55: /**
56: * Returns a contextualized text fragment based on the sought after terms
57: */
58: XmlObject contextFragments(VariantKey key, int fragmentAmount)
59: throws Exception;
60:
61: /**
62: * Cleans up the Hits object
63: */
64: void dispose();
65:
66: }
|