backdrop-contrib / search_api_solr

This module provides an implementation of the Search API which uses an Apache Solr search server for indexing and searching.
GNU General Public License v2.0
0 stars 4 forks source link

Solr search

[1] https://www.drupal.org/node/1999280

Installation

[1] https://github.com/backdrop-contrib/search_api [2] https://github.com/backdrop-contrib/entity_plus

Documentation

Supported optional features

[2] http://lucene.apache.org/java/2_9_1/queryparsersyntax.html [3] http://wiki.apache.org/solr/SolrQuerySyntax

Regarding third-party features, the following are supported:

[4] https://drupal.org/node/2004596 [5] https://drupal.org/sandbox/daspeter/1783280 [6] http://wiki.apache.org/solr/FieldCollapsing

Specifics

Please consider that, since Solr handles tokenizing, stemming and other preprocessing tasks, activating any preprocessors in a search index' settings is usually not needed or even cumbersome. If you are adding an index to a Solr server you should therefore then disable all processors which handle such classic preprocessing tasks. Enabling the HTML filter can be useful, though, as the default config files included in this module don't handle stripping out HTML tags.

Clean field identifiers: If your Solr server was created in a module version prior to 1.2, you will get the option to switch the server to "Clean field identifiers" (which is default for all new servers). This will change the Solr field names used for all fields whose Search API identifiers contain a colon (i.e., all nested fields) to support some advanced functionality, like sorting by distance, for which Solr is buggy when using field names with colons. The only downside of this change is that the data in Solr for these fields will become invalid, so all indexes on the server which contain such fields will be scheduled for re-indexing. (If you don't want to search on incomplete data until the re-indexing is finished, you can additionally manually clear the indexes, on their Status tabs, to prevent this.)

Hidden variables

[8] http://wiki.apache.org/solr/UpdateXmlMessages#A.22commit.22_and_.22optimize.22

Customizing your Solr server

The schema.xml and solrconfig.xml files contain extensive comments on how to add additional features or modify behaviour, e.g., for adding a language- specific stemmer or a stopword list. If you are interested in further customizing your Solr server to your needs, see the Solr wiki at [9] for documentation. When editing the schema.xml and solrconfig.xml files, please only edit the copies in the Solr configuration directory, not directly the ones provided with this module.

[9] http://wiki.apache.org/solr/

You'll have to restart your Solr server after making such changes, for them to take effect.

Developers

The SearchApiSolrService class has a few custom extensions, documented with its code. Methods of note are deleteItems(), which treats the first argument differently in certain cases, and the methods at the end of service.inc.

Also, when requesting facets with a search, you can use the custom "solr_facet_query" key in the facet options to pass an array of facet queries to Solr, which should be used instead of the default "facet.field" parameter. The facet queries will automatically have "FIELD:" prepended to them. The returned facets will have an additional "solr_facet_query" key in addition to "filter" and "count", to spot them more easily.

Current Maintainers

Credits

License

This project is GPL v2 software. See the LICENSE.txt file in this directory for complete text.