Indexes

By default the indexes that are searched in elasticsearch are any index that have a name starting with **relateditems-**. In other words a wild card search across all dated indexes starting with relateditems-

The prefix of the index name is controlled by the following configuration parameter. A hyphen -, will added to the end of the prefix, and any subsequent indexing will index documents into a dated index:

-Drelated-item.storage.index.name.prefix

For example with the setting:

-Drelated-item.storage.index.name.prefix=related

Documents will be indexed and Searching in/from indexes named: related-YYYY-MM-DD.

It is also possible to use an alias against which to perform searches, rather than performing a wild search search. (note The alias does not apply to indexing).

The below gives an example of the curl request used to set up an index in elasticsearch. It creates an alias related, which is an alias for the indexes: relateditems-2013-12-23 and relateditems-2013-12-24. When related is used to search, the search will be performed only against those two indexes.

curl -XPOST localhost:9200/_aliases -d '
{
    "actions": [
        { "add": {"alias": "related", "index": "relateditems-2013-12-23"} },
        { "add": { "alias": "related","index": "relateditems-2013-12-24"} }
    ]
}'

To tell the Search Web Application to use that alias, instead of the wildcard index search, you specify the alias name using the following parameter:

-Drelated-item.storage.index.name.alias=related