public class SolrQuery extends ModifiableSolrParams
Modifier and Type | Class and Description |
---|---|
static class |
SolrQuery.ORDER |
Constructor and Description |
---|
SolrQuery() |
SolrQuery(String q)
Create a new SolrQuery
|
add, add, clear, get, getParameterNames, getParameterNamesIterator, getParams, remove, remove, set, set, set, toString
fpname, get, getBool, getBool, getDouble, getDouble, getFieldBool, getFieldBool, getFieldDouble, getFieldDouble, getFieldFloat, getFieldFloat, getFieldInt, getFieldInt, getFieldParam, getFieldParam, getFieldParams, getFloat, getFloat, getInt, getInt, parseBool, required, toMap, toMultiMap, toNamedList, toSolrParams, wrapAppended, wrapDefaults
public SolrQuery()
public SolrQuery(String q)
q
- query stringpublic SolrQuery setTerms(boolean b)
b
- flag to indicate terms should be enabled. public boolean getTerms()
public String[] getTermsFields()
public String getTermsLower()
public String getTermsUpper()
public SolrQuery setTermsUpperInclusive(boolean b)
public boolean getTermsUpperInclusive()
public SolrQuery setTermsLowerInclusive(boolean b)
public boolean getTermsLowerInclusive()
public SolrQuery setTermsLimit(int limit)
public int getTermsLimit()
public SolrQuery setTermsMinCount(int cnt)
public int getTermsMinCount()
public SolrQuery setTermsMaxCount(int cnt)
public int getTermsMaxCount()
public String getTermsPrefix()
public SolrQuery setTermsRaw(boolean b)
public boolean getTermsRaw()
public String getTermsSortString()
public String getTermsRegex()
public String[] getTermsRegexFlags()
public SolrQuery addFacetField(String... fields)
fields
- Array of field names from the IndexSchemapublic SolrQuery addNumericRangeFacet(String field, Number start, Number end, Number gap)
field
- The fieldstart
- The start of rangeend
- The end of the rangegap
- The gap between each countpublic SolrQuery addDateRangeFacet(String field, Date start, Date end, String gap)
field
- The fieldstart
- The start of rangeend
- The end of the rangegap
- The gap between each countpublic String[] getFacetFields()
public boolean removeFacetField(String name)
name
- Name of the facet field to be removed.public SolrQuery setFacet(boolean b)
b
- flag to indicate faceting should be enabled. public SolrQuery addFacetQuery(String f)
f
- facet querypublic String[] getFacetQuery()
public boolean removeFacetQuery(String q)
q
- the facet query to removepublic SolrQuery setFacetLimit(int lim)
lim
- number facet items to returnpublic int getFacetLimit()
public SolrQuery setFacetMinCount(int cnt)
cnt
- facets having less that cnt hits will be excluded from teh facet listpublic int getFacetMinCount()
public SolrQuery setFacetMissing(Boolean v)
v
- flag to indicate the field of FacetParams.FACET_MISSING
.@Deprecated public SolrQuery setMissing(String fld)
setFacetMissing(Boolean)
public String getFacetSortString()
FacetParams.FACET_SORT_COUNT
@Deprecated public boolean getFacetSort()
getFacetSortString()
instead.FacetParams.FACET_SORT_COUNT
and FacetParams.FACET_SORT_INDEX
public SolrQuery setFacetSort(String sort)
sort
- sort facets@Deprecated public SolrQuery setFacetSort(boolean sort)
setFacetSort(String)
instead, true corresponds to
FacetParams.FACET_SORT_COUNT
and false to FacetParams.FACET_SORT_INDEX
.sort
- sort facetspublic SolrQuery addHighlightField(String f)
f
- field to enable for highlightingpublic boolean removeHighlightField(String f)
f
- field name to not highlightpublic String[] getHighlightFields()
public SolrQuery setHighlightSnippets(int num)
public int getHighlightSnippets()
public SolrQuery setHighlightFragsize(int num)
public int getHighlightFragsize()
public SolrQuery setHighlightRequireFieldMatch(boolean flag)
public boolean getHighlightRequireFieldMatch()
public String getHighlightSimplePre()
public String getHighlightSimplePost()
public SolrQuery setSortField(String field, SolrQuery.ORDER order)
public SolrQuery addSortField(String field, SolrQuery.ORDER order)
public SolrQuery removeSortField(String field, SolrQuery.ORDER order)
public String[] getSortFields()
public String getSortField()
public void setGetFieldStatistics(boolean v)
public void setGetFieldStatistics(String field)
public boolean removeFilterQuery(String fq)
public String[] getFilterQueries()
public boolean getHighlight()
public SolrQuery setHighlight(boolean b)
public String getFields()
public SolrQuery setIncludeScore(boolean includeScore)
public String getQuery()
public Integer getRows()
public void setShowDebugInfo(boolean showDebugInfo)
public Integer getStart()
public SolrQuery setQueryType(String qt)
qt
- Query Type that corresponds to the query request handler on the server.QueryRequest.getPath()
public String getQueryType()
public SolrQuery setParam(String name, String... values)
name
- values
- ModifiableSolrParams.set(String,String[])
public SolrQuery setParam(String name, boolean value)
name
- value
- ModifiableSolrParams.set(String, boolean)
public SolrQuery getCopy()
public SolrQuery setTimeAllowed(Integer milliseconds)
milliseconds
- the time in milliseconds allowed for this querypublic Integer getTimeAllowed()