amateescu / search_api_solr

11 stars 14 forks source link

Installation

Place the search_api_solr module either directly under the /modules directory at the root of your Drupal installation, or place it under /modules/contrib directory instead, to group all contributed modules together.

Next, run composer update from within the module's root directory in order to install all dependencies the module requires to work properly. Alternatively, you can use the composer_manager [1] module to install dependencies.

You can now visit the /admin/modules page on your site and install the Solr search module.

[1] https://www.drupal.org/project/composer_manager

Solr search

This module provides an implementation of the Search API which uses an Apache Solr search server for indexing and searching. Before enabling or using this module, you'll have to follow the instructions given in INSTALL.txt first.

For more detailed documentation, see the handbook [2].

[2] https://drupal.org/node/1999280

Running the test suite

This module comes with a suite of automated tests. To execute those, you just need to have a (correctly configured) Solr instance running at the following address: http://localhost:8983/solr/d8 (This represents a core named "d8" in a default installation of Solr.)

Supported optional features

All Search API datatypes are supported by using appropriate Solr datatypes for indexing them. By default, "String"/"URI" and "Integer"/"Duration" are defined equivalently. However, through manual configuration of the used schema.xml this can be changed arbitrarily. Using your own Solr extensions is thereby also possible.

The "direct" parse mode for queries will result in the keys being directly used as the query to Solr. For details about Lucene's query syntax, see [3]. There are also some Solr additions to this, listed at [4]. Note however that, by default, this module uses the dismax query handler, so searches like "field:value" won't work with the "direct" mode.

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

Regarding third-party features, the following are supported:

If you feel some service option is missing, or have other ideas for improving this implementation, please file a feature request in the project's issue queue, at [8].

[5] https://drupal.org/node/2004596 [6] https://drupal.org/sandbox/daspeter/1783280 [7] http://wiki.apache.org/solr/FieldCollapsing [8] https://drupal.org/project/issues/search_api_solr

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.

Hidden variables

[9] 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 [10] 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.

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

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

Developers