Skip to content

Instantly share code, notes, and snippets.

@alanmackenzie
Created November 14, 2013 15:26
Show Gist options
  • Save alanmackenzie/7468707 to your computer and use it in GitHub Desktop.
Save alanmackenzie/7468707 to your computer and use it in GitHub Desktop.
Drupal Search Api Custom Search Example
<?php
$server = search_api_server_load('acquia_search_solr_server');
$index = search_api_index_load('node_index');
$query = new SearchApiQuery($index);
$query->condition('type', 'article');
$results = $query->execute();
dpm($results);
@algotrader-dotcom
Copy link

It works, notes that field type (conten type) must be checked index

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment