You are here

function apachesolr_reference_autocomplete_callback in Apachesolr Reference 7

Menu callback: autocomplete the label of a SOLR object.

Parameters

string $field_name: The name of the entity-reference field.

string $entity_type: The entity type.

string $bundle_name: The bundle name.

string $entity_id: Optional; The entity ID the entity-reference field is attached to. Defaults to ''.

string $langcode: the language to use.

string $string: The label of the SOLR object to query by.

Return value

json A json array of matching results from SOLR.

1 string reference to 'apachesolr_reference_autocomplete_callback'
apachesolr_reference_menu in ./apachesolr_reference.module
Implements hook_menu().

File

./apachesolr_reference.module, line 71
functionality for creating reference fields to apache solr objects.

Code

function apachesolr_reference_autocomplete_callback($field_name, $entity_type, $bundle_name, $entity_id = '', $langcode = LANGUAGE_NONE, $string = '') {
  $field = field_info_field($field_name);
  $instance = field_info_instance($entity_type, $field_name, $bundle_name);
  return apachesolr_reference_autocomplete_callback_get_matches($field, $instance, $entity_type, $entity_id, $langcode, $string);
}