jsdoc

$.ui.simplicityDiscoverySearch

Namespace $.ui.simplicityDiscoverySearch

Performs a search against the Discovery Search Engine
Defined in: ui.simplicityDiscoverySearch.js.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
<static>  
$.ui.simplicityDiscoverySearch.options
Widget options.
Method Summary
Method Attributes Method Name and Description
<static>  
$.ui.simplicityDiscoverySearch.extractFacetCounts(discoveryResponse)
Converts the search response to a facet counts object using the drillDown response.
<static>  
$.ui.simplicityDiscoverySearch.extractResultSet(discoveryResponse)
Converts the search response to a resultset object.
<static>  
$.ui.simplicityDiscoverySearch.facetCounts(facetCounts, triggerEvent)
Get the or set the facet counts.
<static>  
$.ui.simplicityDiscoverySearch.resultSet(resultSet, triggerEvent)
Get the or set the resultset.
<static>  
$.ui.simplicityDiscoverySearch.search(searchState)
Runs a search.
<static>  
$.ui.simplicityDiscoverySearch.searchResponse(searchResponse, triggerEvent)
Get or set (and process) the search response.
Namespace Detail
$.ui.simplicityDiscoverySearch
  $('body').simplicityState();
  // Create all simplicityInputs widgets
  $('body')
    .simplicityState('mergeQueryParams')
    .simplicityHistory()
    .simplicityState('triggerChangeEvent')
    .simplicityPageSnapBack()
    .simplicityDiscoverySearch({
      url: '/my_search_controller.php'
    })
    .simplicityDiscoverySearch('search');
Field Detail
<static> $.ui.simplicityDiscoverySearch.options
Widget options.
url
The required url to submit the search query.
stateElement
The location of the simplicityState widget. Defaults to 'body'.
searchOnStateChange
When true triggers a search everytime the state changes. Defaults to true.
initialSearchResponse
The initial search response. Used when a page has a server-side search triggered during load. Defaults to {}.
backend
Defaults to 'controller', change to 'engine' to allow for direct queries to an engine.
controllerCallback
The a provided callback that completes or modifies the search query when option backend is 'engine'. Defaults to ''.
dataType
Defaults to 'json', change to 'jsonp' to allow for cross domain search controller support. This requires that your search controller output valid JSONP.
debug
Enable logging of key events to console.log. Defaults to false.
profile
When true requests query profile data from the engine. The profile data can be used to analyze engine query response times. Defaults to false.
triggerFacetCountEvent
When true enables triggering of facet count events. Defaults to false.
triggerResultSetEvent
When true enables triggering of the simplicitySearchResultSet event. Defaults to false.
extractResultSet
When true a standardized resultSet dictionary is available. Defaults to true.
Method Detail
<static> $.ui.simplicityDiscoverySearch.extractFacetCounts(discoveryResponse)
Converts the search response to a facet counts object using the drillDown response.
  Input
  {
    drillDown: [
      {
        dimension: shape,
        ids: ['a', 'b', 'c'],
        exactCounts: [1, 3, 4],
        fuzzyCounts: [2, 6, 8]
      }
    ]
  }
  Output
  {
    shape: {
      exact: {'a': 1, 'b': 3, 'c': 4},
      fuzzy: {'a': 2, 'b': 6, 'c': 8}
    }
  }
Parameters:
discoveryResponse

<static> $.ui.simplicityDiscoverySearch.extractResultSet(discoveryResponse)
Converts the search response to a resultset object.
  Input
  {
    startIndex: 0
    pageSize: 10,
    currentPageSize: 10,
    exactSize: 2,
    totalSize: 120,
    datasetSize: 55000,
    itemIds: ['a', 'b', 'c'],
    relevanceValues: [1.0, 1.0, 0.9],
    exactMatches: [true, true, false],
    properties: [
      {title: 'aaa'},
      {title: 'bbb'},
      {title: 'ccc'}
    ],
    highlighting: [
      {},
      {'title': '[b]bbb[/b]'},
      {}
    ]
  }
  Output
  
  {
    startIndex: 0,
    pageSize: 10,
    exactSize: 2,
    totalSize: 120,
    datasetSize: 55000,
    numRows: 10,
    rows: [
      {
        id: 'a',
        exact: true,
        score: 1.0
        properties: {
          title: 'aaa'
        },
        highlighting: {}
      },
      {
        id: 'b',
        exact: true,
        score: 1.0
        properties: {
          title: 'bbb'
        },
        highlighting: {
          title: '[b]bbb[/b]'
        }
      },
      {
        id: 'c',
        exact: false,
        score: 0.9
        properties: {
          title: 'ccc'
        },
        highlighting: {}
      }
    ]
  }
  
Parameters:
discoveryResponse

<static> $.ui.simplicityDiscoverySearch.facetCounts(facetCounts, triggerEvent)
Get the or set the facet counts. Called with no arguments for get behavior. Triggers a simplicityFacetCounts event on set.
Parameters:
facetCounts
The facet counts to store.
triggerEvent
Optional parameter, set it to false to prevent triggering of events. Defaults to true if not specified.

<static> $.ui.simplicityDiscoverySearch.resultSet(resultSet, triggerEvent)
Get the or set the resultset. Called with no arguments for get behavior. Triggers a simplicityResultSet event on set.
Parameters:
resultSet
The resultset to store.
triggerEvent
Optional parameter, set it to false to prevent triggering of events. Defaults to true if not specified.

<static> $.ui.simplicityDiscoverySearch.search(searchState)
Runs a search. The search happens asynchronously and will trigger multiple events.
  • simplicitySearchSearching (before the ajax request is dispatched). This event may be triggered multiple times in advance of the simplicitySearchResponse event. For example, if any in-flight requests were aborted before the response has been handled, only the last non-aborted response will trigger simplicitySearchResponse.
  • simplicitySearchResponse (original response)
  • ajaxSetup
  • ajaxSuccess
  • ajaxError
  • simplicityFacetCounts
  • simplicityResultSet
  // Bind to a search button
  $('#searchButton').click(function (evt) {
    $('body').simplicityDiscoverySearch('search');
  });
Parameters:
searchState
The search state as a JSON compatible Object. This is an optional parameter, if not specified the search state is obtained from the simplicityState widget.

<static> $.ui.simplicityDiscoverySearch.searchResponse(searchResponse, triggerEvent)
Get or set (and process) the search response. Called with no arguments to retrieve the last response. Called with arguments to process the current response (called by search on success or failure). In processing mode, this method triggers simplicitySearchSearching, simplicitySearchResponse and simplicitySearchResponseHandled events, then calls facetCounts and resultSet.
  // Get the last search response
  var response = $('body').simplicityDiscoverySearch('searchResponse');
  // Process a fake search response for testing purposes
  var response = {
    // Fake response
  };
  $('body').simplicityDiscoverySearch('searchResponse', response);
Parameters:
searchResponse
The search response to process.
triggerEvent
Optional parameter, set it to false to prevent triggering of events. Defaults to true if not specified.

Documentation generated by JsDoc Toolkit 2.4.0