Index: trunk/lucene-search-3/src/main/java/org/wikimedia/lsearch/search/WikiSearcher.java |
— | — | @@ -13,6 +13,7 @@ |
14 | 14 | import org.apache.lucene.document.FieldSelector; |
15 | 15 | import org.apache.lucene.index.CorruptIndexException; |
16 | 16 | import org.apache.lucene.index.Term; |
| 17 | +import org.apache.lucene.search.Collector; |
17 | 18 | import org.apache.lucene.search.Explanation; |
18 | 19 | import org.apache.lucene.search.Filter; |
19 | 20 | import org.apache.lucene.search.HitCollector; |
— | — | @@ -28,20 +29,22 @@ |
29 | 30 | import org.wikimedia.lsearch.interoperability.RMIMessengerClient; |
30 | 31 | |
31 | 32 | /** |
32 | | - * A generalized index searcher, supports various index |
33 | | - * architectures. |
| 33 | + * A generalized index searcher, supports various index architectures. |
34 | 34 | * |
35 | | - * Depending on the structure of the index (single file, |
36 | | - * mainsplit, split) makes either a local |
37 | | - * <code>IndexSearcher</code>, or a <code>MultiSearcher</code> |
| 35 | + * Depending on the structure of the index |
| 36 | + * <li>single file</li> |
| 37 | + * <li>mainsplit</li> |
| 38 | + * <li>split</li> |
| 39 | + * makes either a local <code>IndexSearcher</code>, or a <code>MultiSearcher</code> |
38 | 40 | * with <code>SearchableMul</code> objects distributed via RMI. |
39 | 41 | * |
40 | | - * The local searchers are always preferred (groups are ignored |
41 | | - * for local searchers to avoid ambiguity). |
| 42 | + * The local searchers are always preferred. |
| 43 | + * |
| 44 | + * (groups are ignored for local searchers to avoid ambiguity). |
42 | 45 | * |
| 46 | + * Actual searchers are pulled from {@link SearcherCache}. |
| 47 | + * |
43 | 48 | * |
44 | | - * The actual searchers are pulled from {@link SearcherCache}. |
45 | | - * |
46 | 49 | * @author rainman |
47 | 50 | * |
48 | 51 | */ |
— | — | @@ -171,7 +174,10 @@ |
172 | 175 | public Query rewrite(Query query) throws IOException { |
173 | 176 | return searcher.rewrite(query); |
174 | 177 | } |
175 | | - |
| 178 | + |
| 179 | + /** |
| 180 | + * @deprecated |
| 181 | + */ |
176 | 182 | @Override |
177 | 183 | public void search(Weight weight, Filter filter, HitCollector results) |
178 | 184 | throws IOException { |
— | — | @@ -179,6 +185,13 @@ |
180 | 186 | } |
181 | 187 | |
182 | 188 | @Override |
| 189 | + public void search(Weight weight, Filter filter, Collector results) |
| 190 | + throws IOException { |
| 191 | + searcher.search(weight,filter,results); |
| 192 | + |
| 193 | + } |
| 194 | + |
| 195 | + @Override |
183 | 196 | public TopDocs search(Weight weight, Filter filter, int n) |
184 | 197 | throws IOException { |
185 | 198 | return searcher.search(weight,filter,n); |
— | — | @@ -209,14 +222,16 @@ |
210 | 223 | else |
211 | 224 | return searcher.toString(); |
212 | 225 | } |
213 | | - |
| 226 | + @Override |
214 | 227 | public Document[] docs(int[] i, FieldSelector sel) throws IOException { |
215 | 228 | return searcher.docs(i,sel); |
216 | 229 | } |
217 | | - |
| 230 | + @Override |
218 | 231 | public Document doc(int i, FieldSelector sel) throws CorruptIndexException, IOException { |
219 | 232 | return searcher.doc(i,sel); |
220 | 233 | } |
| 234 | + |
| 235 | + |
221 | 236 | |
222 | 237 | |
223 | 238 | } |