API Docs for: 0.1.0.ee3e9e64
Show:

SolrSearchHandler Class

Module: solr

Represents a default configuration of a request to a Solr search handler.

Item Index

Properties

Methods

buildPayload

(
  • adapter
  • the
  • type
  • operation
  • data
)

<p>Prepares the <a href="../classes/SolrRequestHandler.html#property_data" class="crosslink">data</a> and optinally adjusts the <a href="../classes/SolrRequestHandler.html#property_path" class="crosslink">path</a> properties to send to Solr as a querystring or in an HTTP POST request body.</p> <p>This method mutates the state of the instance it is invoked on and has no return value.</p>

Parameters:

  • adapter SolrAdapter

    <p>the adapter invoking this method</p>

  • the DS.Store

    <p>store related to the type and data</p>

  • type subclass of DS.Model

    <p>the type corresponding to the operation</p>

  • operation String

    <p>the operation e.g. 'find', 'updateRecord', etc.</p>

  • data Object

    <p>the ID(s), query or snapshot payload to prepare.</p>

buildSolrQuery

(
  • adapter
  • type
  • operation
  • query
)
Object protected

Builds a Solr query to send in a search request. This method applies some defaults and converts idiomatic Ember query parameters to their Solr corollaries.

  • Sets wt=json
  • Converts limit to rows
  • Converts offset to start
  • Defaults to q=*:* when no query is specified
  • Calls filterQueryForType and sets fq when a non-blank filter query is returned

Overrides of this method can return an object that includes other query options. Multipe fq parameters (and others) can be defined by using an array for the values:

App.ApplicationAdapter = SolrAdapter.extend({
  buildSolrQuery: function(type, query) {
    return {
      fq: [
        'type:' + type,
        'public:true'
      ]
    };
  }
});

See QueryResponseWriter and CommonQueryParameters.

Parameters:

Returns:

Object:

data hash for ajax request

Properties

data

Object

<p>The data payload to send in the request, as a query string or as a JSON request body.</p>

Default: null

method

String

<p>The HTTP method (verb) to use in the request.</p>

Default: 'GET'

path

Unknown

Inherited from SolrRequestHandler but overwritten in addon/lib/handlers.js:141

Default: 'select'

type

Unknown

Inherited from SolrRequestHandler but overwritten in addon/lib/handlers.js:135

Default: `SolrHandlerType.Search`