public class QueryEnvironment
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
swigCMemOwn |
private long |
swigCPtr |
| Constructor and Description |
|---|
QueryEnvironment() |
QueryEnvironment(long cPtr,
boolean cMemoryOwn) |
| Modifier and Type | Method and Description |
|---|---|
void |
addIndex(java.lang.String pathname)
Add a local repository
|
void |
addServer(java.lang.String hostname)
Add a remote server
|
void |
close()
Close the QueryEnvironment.
|
void |
delete() |
long |
documentCount()
Return total number of documents in the collection.
|
long |
documentCount(java.lang.String term)
Return total number of documents in the collection for the given term.
|
double |
documentExpressionCount(java.lang.String expression)
Return the total number of documents this expression appears in the collection.
|
double |
documentExpressionCount(java.lang.String expression,
java.lang.String queryType)
Return the total number of documents this expression appears in the collection.
|
int[] |
documentIDsFromMetadata(java.lang.String attributeName,
java.lang.String[] attributeValue)
Return a list of document IDs where the document has a metadata key that matches attributeName, with a value matching one of the attributeValues.
|
int |
documentLength(int documentID)
Return all the length of a document.
|
java.lang.String[] |
documentMetadata(int[] documentIDs,
java.lang.String attributeName)
Fetch the named metadata attribute for a list of document ids
|
java.lang.String[] |
documentMetadata(ScoredExtentResult[] documentIDs,
java.lang.String attributeName)
Fetch the named metadata attribute for a list of ScoredExtentResults
|
ParsedDocument[] |
documents(int[] documentIDs)
Fetch the parsed documents for a given list of ScoredExtentResults
|
ParsedDocument[] |
documents(ScoredExtentResult[] results)
Fetch the parsed documents for a given list of ScoredExtentResults
|
ParsedDocument[] |
documentsFromMetadata(java.lang.String attributeName,
java.lang.String[] attributeValue)
Fetch all documents with a metadata key that matches attributeName, with a value matching one of the attributeValues.
|
long |
documentStemCount(java.lang.String stem)
Return all the length of a document.
|
DocumentVector[] |
documentVectors(int[] documentIDs)
Fetch a document vector for a list of documents.
|
double |
expressionCount(java.lang.String expression)
Return the total number of times this expression appears in the collection.
|
double |
expressionCount(java.lang.String expression,
java.lang.String queryType)
Return the total number of times this expression appears in the collection.
|
ScoredExtentResult[] |
expressionList(java.lang.String expression)
Return all the occurrences of this expression in the collection.
|
ScoredExtentResult[] |
expressionList(java.lang.String expression,
java.lang.String queryType)
Return all the occurrences of this expression in the collection.
|
java.lang.String[] |
fieldList()
Return the list of fields.
|
protected void |
finalize() |
static long |
getCPtr(QueryEnvironment obj) |
java.lang.String |
reformulateQuery(java.lang.String query)
Return all the length of a document.
|
void |
removeIndex(java.lang.String pathname)
Remove a local repository
|
void |
removeServer(java.lang.String hostname)
Remove a remote server
|
QueryAnnotation |
runAnnotatedQuery(java.lang.String query,
int resultsRequested)
Run an Indri query language query.
|
QueryAnnotation |
runAnnotatedQuery(java.lang.String query,
int[] documentSet,
int resultsRequested)
Run an Indri query language query on a set of documents.
|
QueryResults |
runQuery(QueryRequest request)
Run an Indri query request
|
ScoredExtentResult[] |
runQuery(java.lang.String query,
int resultsRequested)
Run an Indri query language query.
|
ScoredExtentResult[] |
runQuery(java.lang.String query,
int[] documentSet,
int resultsRequested)
Run an Indri query language query on a set of documents.
|
void |
setFormulationParameters(java.util.Map p)
Return all the length of a document.
|
void |
setMemory(long memory)
Set the amount of memory to use.
|
void |
setScoringRules(java.lang.String[] rules)
Set the scoring rules
|
void |
setStopwords(java.lang.String[] stopwords)
Set the stopword list for query processing
|
long |
stemCount(java.lang.String term)
Return all the length of a document.
|
long |
stemFieldCount(java.lang.String term,
java.lang.String field)
Return all the length of a document.
|
java.lang.String |
stemTerm(java.lang.String term)
Return all the length of a document.
|
long |
termCount()
Return total number of terms.
|
long |
termCount(java.lang.String term)
Return total number of term occurrences.
|
long |
termCountUnique()
Return all the length of a document.
|
long |
termFieldCount(java.lang.String term,
java.lang.String field)
Return total number of term occurrences within a field.
|
public QueryEnvironment(long cPtr,
boolean cMemoryOwn)
public QueryEnvironment()
public static long getCPtr(QueryEnvironment obj)
protected void finalize()
finalize in class java.lang.Objectpublic void delete()
public void addServer(java.lang.String hostname)
throws java.lang.Exception
hostname - the host the server is running onjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void addIndex(java.lang.String pathname)
throws java.lang.Exception
pathname - the path to the repository.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void removeServer(java.lang.String hostname)
throws java.lang.Exception
hostname - the host the server is running onjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void removeIndex(java.lang.String pathname)
throws java.lang.Exception
pathname - the path to the repository.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void close()
throws java.lang.Exception
java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void setMemory(long memory)
throws java.lang.Exception
memory - number of bytes to allocatejava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void setScoringRules(java.lang.String[] rules)
throws java.lang.Exception
rules - the vector of scoring rules.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void setStopwords(java.lang.String[] stopwords)
throws java.lang.Exception
stopwords - the list of stopwordsjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public ScoredExtentResult[] runQuery(java.lang.String query, int resultsRequested) throws java.lang.Exception
query - the query to runresultsRequested - maximum number of results to returnjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public ScoredExtentResult[] runQuery(java.lang.String query, int[] documentSet, int resultsRequested) throws java.lang.Exception
query - the query to runresultsRequested - maximum number of results to returndocumentSet - the list of document ids to score.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public QueryResults runQuery(QueryRequest request) throws java.lang.Exception
request - the query request to runjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public QueryAnnotation runAnnotatedQuery(java.lang.String query, int resultsRequested) throws java.lang.Exception
query - the query to runresultsRequested - maximum number of results to returnjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public QueryAnnotation runAnnotatedQuery(java.lang.String query, int[] documentSet, int resultsRequested) throws java.lang.Exception
query - the query to rundocumentSet - list of document ids to score.resultsRequested - maximum number of results to returnjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public ParsedDocument[] documents(int[] documentIDs) throws java.lang.Exception
documentIDs - the list of ScoredExtentResultsjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public ParsedDocument[] documents(ScoredExtentResult[] results) throws java.lang.Exception
results - the list of ScoredExtentResultsjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public java.lang.String[] documentMetadata(int[] documentIDs,
java.lang.String attributeName)
throws java.lang.Exception
documentIDs - the list of idsattributeName - the name of the metadata attributejava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public java.lang.String[] documentMetadata(ScoredExtentResult[] documentIDs, java.lang.String attributeName) throws java.lang.Exception
documentIDs - the list of ScoredExtentResultsattributeName - the name of the metadata attributejava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public int[] documentIDsFromMetadata(java.lang.String attributeName,
java.lang.String[] attributeValue)
throws java.lang.Exception
attributeName - the name of the metadata attribute (e.g. 'url' or 'docno')attributeValue - values that the metadata attribute should matchjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public ParsedDocument[] documentsFromMetadata(java.lang.String attributeName, java.lang.String[] attributeValue) throws java.lang.Exception
attributeName - the name of the metadata attribute (e.g. 'url' or 'docno')attributeValues - values that the metadata attribute should matchjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public long termCount()
throws java.lang.Exception
java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public long termCount(java.lang.String term)
throws java.lang.Exception
term - the term to countjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public long termFieldCount(java.lang.String term,
java.lang.String field)
throws java.lang.Exception
term - the term to countfield - the name of the fieldjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public java.lang.String[] fieldList()
throws java.lang.Exception
java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public long documentCount()
throws java.lang.Exception
java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public long documentCount(java.lang.String term)
throws java.lang.Exception
term - the term to count documents forjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public DocumentVector[] documentVectors(int[] documentIDs) throws java.lang.Exception
documentIDs - the vector of document ids.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public double expressionCount(java.lang.String expression,
java.lang.String queryType)
throws java.lang.Exception
expression - The expression to evaluate, probably an ordered or unordered window expressionjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public double expressionCount(java.lang.String expression)
throws java.lang.Exception
expression - The expression to evaluate, probably an ordered or unordered window expressionjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public double documentExpressionCount(java.lang.String expression,
java.lang.String queryType)
throws java.lang.Exception
expression - The expression to evaluate, probably an ordered or unordered window expressionjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public double documentExpressionCount(java.lang.String expression)
throws java.lang.Exception
expression - The expression to evaluate, probably an ordered or unordered window expressionjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public ScoredExtentResult[] expressionList(java.lang.String expression, java.lang.String queryType) throws java.lang.Exception
expression - The expression to evaluate, probably an ordered or unordered window expressionjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public ScoredExtentResult[] expressionList(java.lang.String expression) throws java.lang.Exception
expression - The expression to evaluate, probably an ordered or unordered window expressionjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public int documentLength(int documentID)
throws java.lang.Exception
documentID - The internal document id.java.lang.Exceptionpublic void setFormulationParameters(java.util.Map p)
documentID - The internal document id.public java.lang.String reformulateQuery(java.lang.String query)
documentID - The internal document id.public java.lang.String stemTerm(java.lang.String term)
documentID - The internal document id.public long termCountUnique()
documentID - The internal document id.public long stemCount(java.lang.String term)
documentID - The internal document id.public long stemFieldCount(java.lang.String term,
java.lang.String field)
documentID - The internal document id.public long documentStemCount(java.lang.String stem)
documentID - The internal document id.