I have some taxonomies and node belongs to these when i have created search with facet then all node displaying(publishe + unpublish). i want only published node will show.


You need to click the "Filters" tab in your search API index, then check the "Exclude unpublished nodes" option.

  • Try with re indexing all your site content once or run the site cron

  • Did you try with the search api query alter hooks,

function yourmodule_search_api_query_alter(SearchApiQueryInterface $query) {
  $info = entity_get_info($index->item_type);
  $query->condition($info['schema_fields_sql']['base table'], 6, '=');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.