bejean/advanced-search-by-my-solr-server — pull request #7 by romac (2013-08-23 10:13:18+00:00)
Title: Add filters to let other plugins post-process documents about to be sent to Solr as well as modify the search queries.

## Description

This pull request adds three filters that let other plugins post-process documents about to be sent to Solr as well as modify the search queries.

## Example

I've successfully used those filters to add support for multi-languages website using [WPML](wpml.org).
[The plugin fits in a Gist](https://gist.github.com/romac/6317489), adds the post's language code to the document, and only search for document in the current language.

## Filters

### mss_build_document
This filter is applied just before the document is sent to Solr.
The filter callback receives 3 arguments:

| Type | Name | Description |
|---|---|---|
| `Apache_Solr_Document` | `$doc` | The Solr document about to be stored |
| `WP_Post` | `$post` | The Wordpress post that is getting indexed |
| `array` | `$options` | The plugin options |

### mss_query
This filter is applied just before a search query is sent to Solr.
The filter callback receives 2 arguments:

| Type | Name | Description |
|---|---|---|
| `array` | `$args` | See below: |
| `string` | `$args['query']` | The raw query string |
| `array` | `$args['params']` | The [Solr parameters](https://github.com/bejean/advanced-search-by-my-solr-server/blob/master/advanced-search-by-my-solr-server.inc.php#L375-L390) |
| `int` | `$args['offset']` | The starting offset for result documents |
| `int` | `$args['limit']` | The maximum number of result documents to return |
| `array` | `$options` | The plugin options |

### mss_autocomplete
This filter is applied just before an autocomplete query is sent to Solr.
The filter callback receives 2 arguments:

| Type | Name | Description |
|---|---|---|
| `array` | `$args` | See below: |
| `string` | `$args['query']` | The raw query string |
| `array` | `$args['params']` | The [Solr parameters](https://github.com/bejean/advanced-search-by-my-solr-server/blob/master/advanced-search-by-my-solr-server.inc.php#L375-L390) |
| `int` | `$args['limit']` | The maximum number of result documents to return |
| `array` | `$options` | The plugin options |