org.apache.lucene.gdata.search.query
Class QueryTranslator
java.lang.Object
org.apache.lucene.gdata.search.query.QueryTranslator
public class QueryTranslator
- extends Object
Simple static methods to translate the http query to a lucene query string.
- Author:
- Simon Willnauer
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
QueryTranslator
public QueryTranslator()
translateHttpSearchRequest
public static String translateHttpSearchRequest(IndexSchema schema,
Map<String,String[]> parameterMap,
String categoryQuery)
- This method does a little preprocessing of the query. Basically it will map the given request parameters to a lucene syntax. Each
parameter matching a index field in the given schema will be translated into a grouped query string according to the lucene query syntax.
- title=foo bar AND "FooBar" will be title:(foo bar AND "FooBar)
- updated-min=2005-08-09T10:57:00-08:00 will be translated to updated:[1123613820000 TO 9223372036854775807] according to the gdata protocol
- Parameters:
schema
- the index schema for the queried serviceparameterMap
- - the http parameter map returning String[] instances as valuescategoryQuery
- - the parsed category query from the request
- Returns:
- - a lucene syntax query string
Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.