Distributed Search - multiple collections
| Available since version 1.4. |
With the distributed search feature one or more collection(s) that is/are different from the default one can be searched.
That enables the use cases for
-
Distributed search where a set of collection can be used for the same search
-
Different collections can be used for e.g. language/country versions while they all share the same search configuration.
Configuration
The collections that would be searchable have to be defined in the section collections of the search-layer-configurations.json`. Therefore a map that consists in the collection name and their properties is supplied. The properties for each collection are the following:
R = required
| Name | Type | Description | R |
|---|---|---|---|
|
|
Full URL of the solr collection |
✓ |
|
|
Full URL of the solr monitoring collection (If empty the default one would be used) |
|
|
|
Url that points to the solr collection for analytics (If empty the default one would be used) |
Configuration example
Take a look at the collections in our example configuration at http://search-features.demos.contexity.ch/sl/config. The example code below defines the collections wines and empty
{
"collections": {
"empty": {
"solrUrl": "http://localhost:8035/solr/empty",
"monitoringSolrUrl": "http://localhost:8035/solr/sem_monitoring_core_empty",
"analyticsSolrUrl": "http://localhost:8035/solr/sem_monitoring_core_empty"
},
"wines": {
"solrUrl": "http://localhost:8035/solr/winedemo",
"monitoringSolrUrl": "http://localhost:8035/solr/sem_monitoring_core",
"analyticsSolrUrl": "http://localhost:8035/solr/sem_monitoring_core"
}
}
}
Usage
The collection to be used for the search can be specified either
-
by using the parameter
_collection -
by accessing the collections specific endpoint(s):
Specific endpoints for search, suggest, similar, etc. are available under{collectionname}/search,{collectionname}/suggest,{collectionname}/similar, etc.