public class Query extends Object
This class can be used to start a query engine from the command line. Optionally, it can start a web server that will serve the results in a search-engine-like environment. Changes to the query engine made on the command line will reflect on subsequent queries (also on the web server). The web server access is fully multithreaded.
This class does not provide command-line history or editing: to get that effect, we suggest to rely on some operating-system utility such as rlwrap.
Warning: This class is highly experimental (it is the place that we tweak to experiment every kind of new indexing/ranking method).
| Modifier and Type | Class and Description |
|---|---|
static class |
Query.Command |
static class |
Query.OutputType |
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_STEMMING |
| Constructor and Description |
|---|
Query(QueryEngine queryEngine) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
interpretCommand(String line)
Interpret the given command, changing the static variables.
|
static void |
main(String[] arg) |
int |
output(ObjectArrayList<DocumentScoreInfo<Reference2ObjectMap<Index,SelectedInterval[]>>> results,
DocumentCollection documentCollection,
BigList<? extends CharSequence> titleList,
Marker marker)
Scores the given document iterator and produces score output.
|
public static final int MAX_STEMMING
public Query(QueryEngine queryEngine)
public boolean interpretCommand(String line)
line - the command line.public int output(ObjectArrayList<DocumentScoreInfo<Reference2ObjectMap<Index,SelectedInterval[]>>> results, DocumentCollection documentCollection, BigList<? extends CharSequence> titleList, Marker marker) throws IOException
results - an iterator returning instances of DocumentScoreInfo.documentCollection - an optional document collection, or null.titleList - an optional list of titles, or null.marker - an optional text marker to mark snippets, or null.IOException