About multi-index organizations
About multi-index organizations
A multi-index organization is a special type of Coveo organization that allows you to have more than one index. An index stores a copy of the content you want to make searchable, such as your product catalog, videos, and blog posts. When you make a query on a Coveo search interface, Coveo looks for matching entries in your index, and then returns them as search results.
Typically, one index per organization is enough, even if you have millions of content items in it. When creating a search interface, you can have it target some specific sources of content, so that only a subset of your index items can be returned as search results.
However, there are some rare, specific use cases where a multi-index organization could be beneficial. One of these scenarios is when you use your Coveo organization for two completely unrelated and separate implementations of Coveo.
For example, you may want to have a Coveo search page on your intranet, as well as on your commerce website. However, your employees and your customers have different needs and expectations when they use your search pages. Your employees need to access internal documents and data, while your customers are looking for your products and services.
These two use cases are completely independent, as your customers can’t log in to your intranet, and your commerce website doesn’t display any additional content to your employees. So, in this case, having an index for each use case makes sense, especially if your intranet holds a lot of content, which leads to slightly slower responses. In such a case, dedicating an index to your retail website may boost Coveo’s performance, making your commerce search page extra fast.
Multi-index organizations are provided on demand, after Coveo has validated that such an organization would be beneficial to your situation. If you’re interested in this option, please contact your Coveo Sales representative. They will help you evaluate your needs and guide you through the process of setting up a multi-index organization.
Implementing a multi-index scenario
This section explains how to add items and forward queries to a specific Coveo index.
Step 1: Get the index ID
Use the GET /rest/organizations/{organizationId}/logicalindexes
Index API call to list the indexes in your Coveo organization.
To authenticate your request, use an access token granting the View access level on the Logical indexes domain in the target organization.
In the body of a successful response, each object represents an index.
Locate the id
of the desired index.
GET https://platform.cloud.coveo.com/rest/organizations/mycoveoorganizationg8tp8wu3/logicalindexes HTTP/1.1
Accept: application/json
Authorization: Bearer **********-****-****-****-************
Successful response body (200 OK)
[
{
"id": "default",
"name": "default",
"organizationId": "mycoveoorganizationg8tp8wu3"
},
{
"id": "mycoveoorganizationg8tp8wu3-3m577icm",
"name": "Acme Catalog Index",
"organizationId": "mycoveoorganizationg8tp8wu3"
}
]
Note
From a Coveo API point of view, Coveo indexes are referred to as logical indexes. This is due to the fact that an index usually has one or more mirrors for load balancing and scalability. Therefore, a given logical index actually represents a group of identical Coveo indexes (that is, a Coveo index and its mirrors). However, for the sake of simplicity, this nuance is generally omitted in Coveo’s product documentation. Therefore, index and logical index should be considered synonyms. |
Step 2: Index some content
-
Use the Coveo Administration Console to configure a source that should contribute content to a specific, non-default Coveo index. Store the unique identifier of the newly created source (for example,
mycoveoorganizationg8tp8wu3-s2etiqjxk2qjwu7ozdymiscp6y
).Tips-
Use a temporary name when creating the source (for example,
temp_catalog
). This way, you can use a truly meaningful name when duplicating the source in the next sub-step. -
Click Add Source (not Add and build source) to create the source. This way, no content will be needlessly crawled and pulled into the default Coveo index.
-
-
Use the
POST rest/organizations/{organizationId}/sources/{sourceId}/duplicate
Source API operation to duplicate the previously created source, setting thelogicalIndex
query parameter to theid
of the Coveo index to which the source should contribute content (for example, theid
retrieved and stored in step 1).Authenticate the request using an access token granting the Edit access level on the Sources domain in the target organization.
ExamplePOST https://platform.cloud.coveo.com/rest/organizations/mycoveoorganizationg8tp8wu3/sources/mycoveoorganizationg8tp8wu3-s2etiqjxk2qjwu7ozdymiscp6y/duplicate?newSourceName=catalog&logicalIndex=mycoveoorganizationg8tp8wu3-3m577icm HTTP/1.1 Content-Type: application/json Accept: application/json Authorization: Bearer **********-****-****-****-************
Successful response body excerpt (201 Created)
{ ... "id": "mycoveoorganization8tp8wu3-rg7paembd5ss7tvnhkv2k4soqa", ... "logicalIndex": "mycoveoorganizationg8tp8wu3-3m577icm", ... }
Notes-
The
logicalIndex
property of a source can’t be modified after that source has been created. -
Duplicating a non-Push source automatically triggers a build on the duplicate.
-
-
Optionally, use the Administration Console to delete the original source.
-
Repeat sub-steps 1, 2, and 3 as needed.
Step 3: Send queries to the index
In the query pipeline to which are routed queries that should target a specific, non-default Coveo index (for example, the one whose id
you retrieved and stored in step 1), create a query parameter rule that sets the logicalIndex
parameter to the desired value.
Query pipeline condition:
when $searchHub is "StoreSearch"
Query parameter rule definition:
override query logicalIndex: mycoveoorganizationg8tp8wu3-3m577icm
Notes
|