Terrier IR Platform
2.2.1

uk.ac.gla.terrier.querying.parser
Class QueryParser

java.lang.Object
  extended by uk.ac.gla.terrier.querying.parser.QueryParser

public class QueryParser
extends java.lang.Object

Useful class to parse the query. (We should have had this class years ago). This class replaces all replicated code about how to parse a String query into a Query tree, and add it to a pre-existing search request. This is most often called from Manager.newSearchRequest(String,String), although client code can use this method when other forms of Manager.newSearchRequest() are used. Note that this class throws QueryParserException when it gets upset.

Since:
2.0
Version:
$Revision: 1.3 $
Author:
Craig Macdonald

Constructor Summary
QueryParser()
           
 
Method Summary
static Query parseQuery(java.lang.String query)
          Parse the specified query.
static void parseQuery(java.lang.String query, SearchRequest srq)
          Parse the query specified in String query, and use it for the specified search request.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryParser

public QueryParser()
Method Detail

parseQuery

public static void parseQuery(java.lang.String query,
                              SearchRequest srq)
                       throws QueryParserException
Parse the query specified in String query, and use it for the specified search request. Under normal usage, called by newSearchRequest(String,String).

Parameters:
query - The string query to parse
srq - The request object that the manager can use
Throws:
QueryParserException - when the query cannot be parsed
Since:
2.0

parseQuery

public static Query parseQuery(java.lang.String query)
                        throws QueryParserException
Parse the specified query.

Parameters:
query - The string query to parse
Throws:
QueryParserException - when the query cannot be parsed
Since:
2.0

Terrier IR Platform
2.2.1

Terrier Information Retrieval Platform 2.2.1. Copyright 2004-2008 University of Glasgow