You are here

function apachesolr_autocomplete_basic_params in Apache Solr Autocomplete 6

Same name and namespace in other branches
  1. 7 apachesolr_autocomplete.module \apachesolr_autocomplete_basic_params()

Return the basic set of parameters for the Solr query.

Parameters

$suggestions_to_return: Number of facets to return.

Return value

array

2 calls to apachesolr_autocomplete_basic_params()
apachesolr_autocomplete_suggest_additional_term in ./apachesolr_autocomplete.module
Helper function that suggests additional terms to search for.
apachesolr_autocomplete_suggest_word_completion in ./apachesolr_autocomplete.module
Helper function that suggests ways to complete partial words.

File

./apachesolr_autocomplete.module, line 195
Alters search forms to suggest terms using Apache Solr using AJAX. Thanks to robertDouglass who contributed some of the code.

Code

function apachesolr_autocomplete_basic_params($suggestions_to_return) {
  return array(
    'facet' => 'true',
    'facet.field' => array(
      'spell',
    ),
    // We ask for $suggestions_to_return * 5 facets, because we want
    // not-too-frequent terms (will be filtered below). 5 is just my best guess.
    'facet.limit' => $suggestions_to_return * 5,
    'facet.mincount' => 1,
    'start' => 0,
    'rows' => 0,
  );
}