org.galagosearch.core.retrieval.query
Class SimpleQuery
java.lang.Object
org.galagosearch.core.retrieval.query.SimpleQuery
public class SimpleQuery
- extends java.lang.Object
SimpleQuery parses the kind of queries you might expect for a end-user search engine.
The format is also meant to be similar to Lucene's query format.
Queries can be single terms:
white house
or phrases:
"white house"
and have fields:
title:"white house"
or weights:
white^4 house^2
A query can be parsed into a list of QueryTerms or translated into a tree of Nodes
which can be used with the StructuredRetrieval code.
- Author:
- trevor
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleQuery
public SimpleQuery()
parseQueryTerm
public static SimpleQuery.QueryTerm parseQueryTerm(java.lang.String term)
- The format of the query term is field:term^weight.
Both the field and the weight are optional, and the term may
be enclosed in quotes.
- Returns:
- A QueryTerm object describing the query term.
textQueryTerms
public static java.util.List<java.lang.String> textQueryTerms(java.lang.String query)
parse
public static java.util.List<SimpleQuery.QueryTerm> parse(java.lang.String query)
parseTree
public static Node parseTree(java.lang.String query)
Copyright © 2009. All Rights Reserved.