QueryBuilder

class QueryBuilder(server: SolrClient, query: String)(implicit parser: ExpressionParser) extends QueryBuilderBase[QueryBuilder]
class Object
trait Matchable
class Any

Value members

Concrete methods

protected def createCopy: QueryBuilder
def getResultAs[T](params: Any)(implicit m: ClassTag[T]): CaseClassQueryResult[T]

Returns the search result of this query as the case class.

Returns the search result of this query as the case class.

Value Params
params

the parameter map or case class which would be given to the query

Returns

the search result

def getResultAsMap(params: Any): MapQueryResult

Returns the search result of this query as List[Map[String, Any]].

Returns the search result of this query as List[Map[String, Any]].

Value Params
params

the parameter map or case class which would be given to the query

Returns

the search result

Inherited methods

def collapseBy(field: String, expandCount: Int): QueryBuilder
Inherited from
QueryBuilderBase
def collection(collection: String): QueryBuilder
Inherited from
QueryBuilderBase
protected def docToMap(doc: SolrDocument): DocumentMap
Inherited from
QueryBuilderBase

Added in response to #63 Missing spatial parameters while building solr query Enable Spatial is true.

Added in response to #63 Missing spatial parameters while building solr query Enable Spatial is true.

Inherited from
QueryBuilderBase
def facetFields(fields: String*): QueryBuilder

Sets facet field names.

Sets facet field names.

Value Params
fields

field names

Inherited from
QueryBuilderBase
def facetPivotFields(pivotField: String*): QueryBuilder

Sets facet pivot field names.

Sets facet pivot field names.

Value Params
pivotField

field names

Inherited from
QueryBuilderBase
def facetQuery(fq: String): QueryBuilder
Inherited from
QueryBuilderBase
def fields(fields: String*): QueryBuilder

Sets field names to retrieve by this query.

Sets field names to retrieve by this query.

Value Params
fields

field names

Inherited from
QueryBuilderBase
def filteredQuery(fq: String*): QueryBuilder
Inherited from
QueryBuilderBase
def groupBy(fields: String*): QueryBuilder

Sets grouping field names.

Sets grouping field names.

Value Params
fields

field names

Inherited from
QueryBuilderBase
def highlight(field: String, size: Int, prefix: String, postfix: String, snippets: Int): QueryBuilder

Configures to retrieve a highlighted snippet. Highlighted snippet is set as the "highlight" property of the map or the case class.

Configures to retrieve a highlighted snippet. Highlighted snippet is set as the "highlight" property of the map or the case class.

Value Params
field

the highlight field

postfix

the postfix of highlighted ranges

prefix

the prefix of highlighted ranges

size

the highlight fragment size

Inherited from
QueryBuilderBase
def id(id: String): QueryBuilder

Sets the field name of the unique key.

Sets the field name of the unique key.

Value Params
id

the field name of the unique key (default is "id").

Inherited from
QueryBuilderBase
def limitGrouping(limit: Int): QueryBuilder
Inherited from
QueryBuilderBase
def recommend(fields: String*): QueryBuilder

Configure to recommendation search. If you call this method, the query returns documents similar to the query result instead of them.

Configure to recommendation search. If you call this method, the query returns documents similar to the query result instead of them.

Value Params
fields

field names of recommendation target

Inherited from
QueryBuilderBase
protected def responseToMap(response: QueryResponse): MapQueryResult
Inherited from
QueryBuilderBase
def responseToObject[T](response: QueryResponse)(implicit m: ClassTag[T]): CaseClassQueryResult[T]
Inherited from
QueryBuilderBase
def rows(rows: Int): QueryBuilder

Specifies the maximum number of results to return.

Specifies the maximum number of results to return.

Value Params
rows

number of results

Inherited from
QueryBuilderBase
def setRequestHandler(handler: String): QueryBuilder

Sets the RequestHandler for the Solr query

Sets the RequestHandler for the Solr query

Value Params
handler

the name of the RequestHandler as defined in solrconfig.xml (default is "/select").

Inherited from
QueryBuilderBase
def sortBy(field: String, order: Order): QueryBuilder

Sets the sorting field name and its order.

Sets the sorting field name and its order.

Value Params
field

the sorting field name

order

the sorting order

Inherited from
QueryBuilderBase
def spatialPt(lat: Double, lng: Double): QueryBuilder

Added in response to #63 Missing spatial parameters while building solr query

Added in response to #63 Missing spatial parameters while building solr query

  • Sets Spatial field called pt.
Inherited from
QueryBuilderBase
def spatialSfield(value: String): QueryBuilder

Added in response to #63 Missing spatial parameters while building solr query Sets Spatial field named SField.

Added in response to #63 Missing spatial parameters while building solr query Sets Spatial field named SField.

Value Params
value

: value for Sfield.

Inherited from
QueryBuilderBase
def start(start: Int): QueryBuilder

Sets the offset to start at in the result set.

Sets the offset to start at in the result set.

Value Params
start

zero-based offset

Inherited from
QueryBuilderBase
def toFacetPivotList(pivotFields: List[PivotField]): List[FacetPivot]

Convert java list of Pivot fields to scala list of facetPivots

Convert java list of Pivot fields to scala list of facetPivots

Inherited from
QueryBuilderBase

Inherited fields

protected var collection: String
Inherited from
QueryBuilderBase
protected var highlightField: String
Inherited from
QueryBuilderBase
protected var id: String
Inherited from
QueryBuilderBase
protected var recommendFlag: Boolean
Inherited from
QueryBuilderBase
protected var solrQuery: SolrQuery
Inherited from
QueryBuilderBase