1
2
3 package org.galagosearch.core.retrieval;
4
5 import java.io.IOException;
6 import org.galagosearch.core.retrieval.query.Node;
7 import org.galagosearch.core.retrieval.structured.StructuredRetrieval;
8
9 /***
10 * <p>This is a base class for all kinds of retrieval classes. Historically this was
11 * used to support binned indexes in addition to structured indexes.</p>
12 *
13 * @author trevor
14 */
15 public abstract class Retrieval {
16 public abstract String getDocumentName(int document) throws IOException;
17 /***
18 * Transforms the query into a more complete representation that can
19 * be directly executed.
20 */
21 public abstract Node transformQuery(Node query) throws Exception;
22 public abstract ScoredDocument[] runQuery(Node query, int requested) throws Exception;
23 public abstract void close() throws IOException;
24
25 static public Retrieval instance(String indexPath) throws IOException {
26 return new StructuredRetrieval(indexPath);
27 }
28 }