This module provides a framework for easily creating searches on any entity known to Drupal, using any kind of search engine. For site administrators, it is a great alternative to other search solutions, since it already incorporates facetting support and the ability to use the Views module for displaying search results, filters, etc. Also, with the Apache Solr integration, a high-performance search engine is available for this module.
Developers, on the other hand, will be impressed by the large flexibility and numerous ways of extension the module provides. Hence, the growing number of additional contrib modules (linked below), providing additional functionality or helping users customize some aspects of the search process.
There is a screencast available, showing off some of this project's features. (Note, however, that it doesn't represent the current development state – e.g., facets can now be used with the database search, too.)
Note on security
In general, the Search API doesn't provide any kind of access restrictions (as this cannot be done on a generic level). It is therefore your responsibility to take care that only accessible items are indexed or results displayed (e.g., by using appropriate filters).
There is, however, built-in support for node access checks via the Node access data alteration (q.v. for details). Also, the Search views module contains an option to do additional access checks on all entities in search views.
Additional modules
At the moment, this project contains, apart from the core API module, the following extension modules:
Search views
This module integrates the Search API with the Views module, allowing searches on any index to be created and viewed via Views. All of an entity's properties, as well as those of related entities (e.g. a node's author's name), are available as fields, filters and arguments for all indexed fields are available and sorts (as well as click sorts) can be created on any indexed single-valued field. Also some additional features, like linking the results to the entity, are available.
Search facets
This module provides the ability to create facets on any search executed anywhere in Drupal, be it a search page, a view or any other source. The feature isn't available for all servers, though, since it would be too complex to implement for some service classes. Right now only the Solr servers support this, facet support for the database-based searches might be done in the future.
Note: The previously contained modules Database search and Search pages have now been moved to external projects. If you use one of these modules, please download it from its new project now. The old versions still contained in this project will be removed soon, and not receive any updates until then.
Screencast
A screencast showing all the latest features can be viewed here and downloaded here.
Other available backends and extensions
- Solr search
- A backend using an Apache Solr server for indexing and searching, like the popular Apache Solr Search Integration module. It uses dynamic fields for indexing arbitrary entities and boasts far superior indexing- and search-performance, better result accuracy and native facetting support.
- Database search
- A simple, database-based backend for indexing and searching data. It's neither very fast nor accurate, but it works out of the box and can be used for testing out the Search API capabilities (it even supports facetting), or for smaller sites (or smaller, less important indexes/searches).
- Fuzzy Search
- A more advanced database-based backend which also allows fuzzy matches and substring matching.
- Xapian
- The xapian project now includes a seperate module, search_api_xapian, that provides a Xapian backend for the Search API. Facets currently aren't supported yet, but planned for the future (as of January 2011).
- Sarnia
- Sarnia is an extension of the Solr search module which provides the capability to search and display non-Drupal data indexed in Solr.
- Mongo DB backend
- Uses a Mongo DB for indexing and searching. Fast and scalable, it's a great alternative to the normal database backend.
- Search pages
- A module for creating simple search pages, not using Views or any other modules. They can be used when a view would be unnecessarily slow, or for quickly testing out functionality. They also provide search blocks for starting a search from anywhere on the site.
- Multi-index searches
- An extension for executing a search query on several indexes at once, for servers supporting that feature (like servers with the Solr backend).
- Saved searches
- Lets users create search notifications so they are notified when new results are available.
- Autocomplete
- Allows to add dynamic autocompletion to fulltext key fields on search forms.
- Search API attachments
- An extension that uses the Apache Tika library to allow indexing of attachment (or other file) contents.
- Extended search page
- This module provides a page like the default "Find content" page, but based on the Search API and therefore more flexible and richer in features.
- Pretty Facets Paths
- Allows site admins to rewrite the facet URLs for taxonomy terms to use the path instead of additional GET parameters.
- Search API ranges
- Adds the ability to add range facets for numeric fields to searches, with a nice ruler UI.
- Search API sorts
- Offers highly configurable sort blocks for all searches.
- Search API context
- Provides "context-sensitive" blocks for Search API.
- Search API AJAX
- Provides base functionality for AJAXifying search pages.
- Search API Location
- Allows indexing and searching of geolocation data with the Solr backend.
- Search API live results
- Alternative to Autocomplete that shows potential results while typing.
Requirements
You will have to download and enable the Entity API module to use the Search API.
To use the Views integration, you'll (of course) also need the Views module.
Information for developers
Extensive documentation for other developers, who might want to extend the framework's capabilities themselves, is available. If you are trying to implement some extension point and are stuck, please don't hesitate to ask in the module's issue queue. Please also tell me when you are done (or when your module has hit a usable state), so I can link to your project here.
All developers working in the Search API ecosystem are advised to keep an eye on #1188562: [meta] Important project announcements for important updates.
Also interesting for developers might be a session I held at Drupal Dev Days Brussels, which has the slides available online and explains the framework's architecture from a developer's point of view.
Related material
AJAXified search facets with Views and Panels
Discussions about performance (compared to apachesolr)
How to setup Search API with Apache Solr
Adding custom fields to a search index
My session from Drupalcon Munich with a setup tutorial
Credits
This project was developed as part of the Google Summer of Code
2010 (detailed information).
Further development was sponsored by epiqo.
If you are interested in sponsoring a particular feature or new related module, please contact me. I'm also available for consulting.
Downloads
Recommended releases
Development releases
Project Information
- Maintenance status: Actively maintained
- Development status: Under active development
- Module categories: Search, Views
- Reported installs: 17525 sites currently report using this module. View usage statistics.
- Downloads: 227,175
- Automated tests: Enabled
- Last modified: November 6, 2012
