it.unimi.dsi.mg4j.query |
MG4J: Managing Gigabytes for Java
User interfaces for querying indices.
Most classes in this package are just suggestions or experiments. The
{@link it.unimi.dsi.mg4j.query.Query} tool lets you query one or more indices on
the command line or possibly using a browser. The displayed results can be linked
to actual data (files, collections, etc.) using items such as
{@link it.unimi.dsi.mg4j.query.GenericItem} or {@link it.unimi.dsi.mg4j.query.FileSystemItem}.
|
Java Source File Name | Type | Comment |
BrowseItem.java | Class | An instance of this class is used to pack the results gathered by
it.unimi.dsi.mg4j.query.QueryServlet in such a way that they are easily accessible from the Velocity Template Language. |
FileSystemItem.java | Class | An item serving a file from the file system.
This kind of
it.unimi.dsi.mg4j.query.QueryServlet item will load into the browser
the file specified by the parameter uri . |
GenericItem.java | Class | An generic item, displaying all document fields.
This kind of
it.unimi.dsi.mg4j.query.QueryServlet item will display each field
of a document inside a FIELDSET element. |
HelpPage.java | Class | The help page. |
HttpFileServer.java | Class | A minimal, singleton server serving the whole filesystem.
For security reasons, some browsers (notably Firefox at the time of this writing)
do not serve file: content from a non-file: page. |
HttpQueryServer.java | Class | A very basic HTTP server answering queries.
The main method of this class starts a very basic HTTP server answering queries.
If a matching document collection is provided, the server will also display some
intervals satisfying the queries.
Queries are served by the
it.unimi.dsi.mg4j.query.QueryServlet ; by
default, the servlet listen on port 4242, and the servlet is deployed under
the path /Query. |
InputStreamItem.java | Class | An item serving a raw input stream from the document collection.
This kind of
it.unimi.dsi.mg4j.query.QueryServlet item will load into the browser
the stream returned by the document collection for the given document. |
IntervalSelector.java | Class | A strategy for selecting reasonable intervals to be shown to the user.
MG4J returns for each query and each document a list of minimal intervals satisfying the query.
Due to overlaps and long intervals, this list is not always the best way to show the result of
a query to the user. |
Marker.java | Interface | A strategy for marking words.
When showing snippets to the user, it is necessary to highlight intervals, and to mark the
start and the end of an excerpt. |
MarkingMutableString.java | Class | A mutable string with a special method to append text that should be marked.
A marking mutable string can mark several fields (which will often correspond to indexed fields).
Each time you
, you pass some intervals to be marked. |
Query.java | Class | A command-line interpreter to query indices.
This class can be used to start a
from the command line. |
QueryEngine.java | Class | An engine that takes a query and returns results, using a programmable
set of scorers and policies.
This class embodies most of the work that must be done when answering a query.
Basically,
QueryEngine.process(String,int,int,ObjectArrayList) process(query,offset,length,results) takes query ,
parses it, turns it into a document iterator, scans the results, and deposits
length results starting at offset into the list results .
There however several additional features available. |
QueryServlet.java | Class | A query servlet.
This class provides a basic servlet for searching a collection.
It expects some data (a collection, an index map and a path)
in the
javax.servlet.ServletContext (see the code for
QueryServlet.init() ). |
ResultItem.java | Class | An instance of this class is used to pack the results gathered by
it.unimi.dsi.mg4j.query.QueryServlet in such a way that they are easily accessible from the Velocity Template Language. |
SelectedInterval.java | Class | An interval selected for display. |
TextMarker.java | Class | A marker for text/HTML output.
This class has few instances, which are accessible by means of final static fields. |