Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Key auth 2.2.4 Minor update available for module key_auth (2.2.4). Release: SAML SSO - Service Provider 3.2.0 Minor update available for module miniorange_saml (3.2.0). Release: amazee.ai Private AI Provider 1.4.3 Minor update available for module ai_provider_amazeeio (1.4.3). Release: amazee.ai Private AI Provider 1.3.7 Minor update available for module ai_provider_amazeeio (1.3.7). Release: WebProfiler 11.2.3 Minor update available for module webprofiler (11.2.3). Release: Acquia DAM 1.1.18 Minor update available for module acquia_dam (1.1.18). Release: Field Validation 3.0.0-rc1 First release candidate for module field_validation (3.0.0-rc1). Usage Milestone: Easy Breadcrumb Module easy_breadcrumb crossed 100,000 active installs. Release: Central Authentication System (CAS) Server 2.0.4 Minor update available for module cas_server (2.0.4). Module Revived: CSP log 1.0.2 Module csp_log updated after 18 months of inactivity (1.0.2).

CRM Search API

1 sites Security covered Drupal 11 · not 10

Part of the CRM ecosystem · 13 projects

View on drupal.org

This project enhances the search functionality of Drupal websites by integrating with the Search API module. It provides advanced search capabilities, allowing users to easily find content within their Drupal site.

Search API indexes of CRM contacts do not apply CRM’s grant model by default. Without access filtering, contact search can expose private records to users who should not see them.

CRM Search API adds an opt-in CRM contact access processor. It indexes view grants and user–contact mappings, then filters Search API queries with the same access rules used by Views, list builders, and core Contact Search.

Use it whenever you build contact search with Search API—Database Search, Solr, Facets, or Search API Views—and contact privacy matters.

Features

  • Grant indexing — Denormalizes view grants from crm_contact_access into the search index.
  • Mapped-user indexing — Indexes user IDs mapped to each contact for blanket mapped access.
  • Access parity — Filters queries using the same model as Views and Contact Search: bypass permissions, bundle permissions, mapped access, and grant tokens (including hook_crm_contact_grants()).
  • Opt-in per index — Indexes do not enforce contact access until you enable the processor.
  • Mapping-aware reindex — When user–contact mappings change, affected contacts are marked for reindex automatically.
  • Mixed-datasource safe — On indexes that mix entity types, only CRM contacts are filtered.
  • Backend agnostic — Works with any Search API backend.

Example use cases:

  • A member directory where each person only sees contacts they are allowed to view.
  • Staff CRM search over Solr or Database Search with role- and grant-based privacy.
  • Faceted contact search that must match CRM’s existing access rules.

Post-Installation

This module has no configuration form of its own. After installing CRM, Search API, and a search backend:

  1. Enable CRM Search API.
  2. Create a Search API server and index.
  3. Add the CRM contact datasource (entity:crm_contact).
  4. On the index Processors tab, enable CRM contact access.
  5. Save the index and index (or reindex) items.
  6. Build Views, Facets, or other Search API UIs against the index as usual.

Assign CRM permissions and grants as needed (administer crm, view any crm contact, bundle-specific view permissions, view mapped crm contact, plus your grant setup). After access-model changes that do not go through mapping hooks, reindex affected contacts so search stays in sync.

Additional Requirements

  • CRM (^1.0.0-beta5)
  • Search API
  • Drupal 11.1 or later
  • A Search API backend (for example Database Search or Solr)
  • Database Search or Search API Solr — search backends for your index.
  • Facets — faceted browsing on contact indexes.
  • CRM’s crm_simpsons recipe — sample contacts for local exploration (see DDEV setup below).

Similar projects

  • CRM Contact Search — CRM’s built-in core Search plugin uses the same access model, but it is not Search API. Use this module when you need Search API indexes, backends, Views, or Facets.
  • Search API Content access — Filters node search by node_access. CRM Search API is the equivalent for CRM contacts and the crm_contact_access grant system.

Supporting this Module

Local development for this project relies on DDEV. If you use DDEV, consider sponsoring DDEV development.

Community Documentation

  • README in the project repository
  • Issue queue for questions, bugs, and feature requests

Develop with DDEV

If you have not already, install DDEV, then:

git clone [email protected]:project/crm_search_api.git
cd crm_search_api
ddev config --project-type=drupal --docroot=web --php-version=8.4 --corepack-enable --project-name=crm-search-api
ddev add-on get ddev/ddev-drupal-contrib
ddev add-on get s-ayers/ddev-drupal-contrib-mkdocs
ddev add-on get s-ayers/ddev-drupal-paratest
ddev start
ddev poser
ddev symlink-project
ddev drush site:install -y
ddev drush pm:install crm_search_api -y
ddev drush config:export -y
ddev drush user:login
ddev drush recipe modules/contrib/crm/recipes/crm_simpsons

Consider sponsoring DDEV development.

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Jul 2026
Latest release
2 weeks ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
1.0.0 Stable 11 Aug 26, 2026
1.0.0-alpha1 Pre-release 11 Aug 2, 2026
1.0.x-dev Dev 11 Jul 26, 2026