public class QueryParser extends Object
Query query = new SimpleQuery(new Criteria("field_1").is("value_1").and("field_2").startsWith("value_2")).addProjection("field_3").setPageRequest(new PageRequest(0, 10));
Will be parsed to a SolrQuery that outputs the following
q=field_1%3Avalue_1+AND+field_2%3Avalue_2*&fl=field_3&start=0&rows=10
Modifier and Type | Field and Description |
---|---|
static String |
CRITERIA_VALUE_SEPERATOR |
static String |
WILDCARD |
Constructor and Description |
---|
QueryParser() |
Modifier and Type | Method and Description |
---|---|
org.apache.solr.client.solrj.SolrQuery |
constructSolrQuery(SolrDataQuery query)
Convert given Query into a SolrQuery executable via
SolrServer |
protected String |
createQueryFragmentForCriteria(Criteria chainedCriteria) |
String |
getQueryString(SolrDataQuery query)
Get the queryString to use withSolrQuery.setParam(CommonParams.Q, "queryString"}
|
void |
registerConverter(Converter<?,?> converter)
Register an additional converter for transforming object values to solr readable format
|
public static final String WILDCARD
public static final String CRITERIA_VALUE_SEPERATOR
public final org.apache.solr.client.solrj.SolrQuery constructSolrQuery(SolrDataQuery query)
SolrServer
query
- public String getQueryString(SolrDataQuery query)
query
- protected String createQueryFragmentForCriteria(Criteria chainedCriteria)
public void registerConverter(Converter<?,?> converter)
converter
- Copyright © 2011-2013-2013 SpringSource. All Rights Reserved.