-
-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update docs for multi index search (#838)
- Loading branch information
Showing
2 changed files
with
96 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
packages/docs/src/content/docs/cloud/performing-search/multi-index-search.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
--- | ||
title: Performing search across multiple indexes on Orama Cloud | ||
description: Learn how to perform search across multiple indexes on Orama Cloud. | ||
--- | ||
import { Aside } from '@astrojs/starlight/components'; | ||
import { Tabs, TabItem } from '@astrojs/starlight/components'; | ||
|
||
After deploying your index, Orama will distribute it to over 300 global points of presence across more than 100 countries worldwide. This will guarantee the lowest possible latency for any search query, at any scale. | ||
|
||
At the time of this writing, you can execute search queries using our official JavaScript SDK. | ||
|
||
This SDK manages connection, cache, telemetry, and type safety for all your search operations. It is the official method for communicating with Orama Cloud. | ||
|
||
<Aside type="tip" title='Installing the Orama SDK'> | ||
You can find the guide on installing the SDK [here](/cloud/integrating-orama-cloud/javascript-sdk). | ||
</Aside> | ||
|
||
Make sure you have the Orama SDK installed to start performing full-text, vector, and hybrid search at a massive scale! | ||
|
||
## Seach across multiple indexes deployed on Orama Cloud | ||
|
||
<Aside type="caution" title='Experimental feature'> | ||
This is feature is still in expermintal phase and only available for JavaScript SDK. | ||
</Aside> | ||
|
||
Once you have your SDK for your preferred language installed, you can start performing search across multiple indexes deployed on Orama Cloud. | ||
|
||
The client exposes a simple `search` method that can be used to query the index. Read the full documentation [here](/cloud/performing-search/full-text-search) | ||
|
||
### Search across multiple indexes | ||
|
||
<Tabs syncKey="sdk"> | ||
<TabItem label="JavaScript" icon="seti:javascript"> | ||
```typescript | ||
import { OramaClient } from "@oramacloud/client"; | ||
|
||
const client = new OramaClient({ | ||
mergeResults: false | ||
indexes:[ | ||
{api_key: "<Your Orama Cloud API Key index 1>", endpoint:"<Your Orama Cloud Endpoint index 1>"}, | ||
{api_key: "<Your Orama Cloud API Key index 2>", endpoint:"<Your Orama Cloud Endpoint index 2>"}, | ||
] | ||
}); | ||
|
||
const results = await client.search({ | ||
term: "red shoes", | ||
mode: "fulltext", // optional, default is "fulltext" but can also be "vector" or "hybrid" | ||
}); | ||
``` | ||
</TabItem> | ||
</Tabs> | ||
|
||
### Result | ||
This will return an array of search results from both indexes. | ||
|
||
```json | ||
[ | ||
{ | ||
"elapsed": ..., | ||
"count": ..., | ||
"hits": { ... }, | ||
}, | ||
{ | ||
"elapsed": ..., | ||
"count": ..., | ||
"hits": { ... }, | ||
} | ||
] | ||
``` | ||
|
||
If `mergeResults` is set to `true`, the results will be merged into a single results. | ||
|
||
```json | ||
{ | ||
"elapsed": ..., | ||
"count": ..., | ||
"hits": { ... }, | ||
} | ||
``` | ||
|
||
<Aside type="caution" title="Limitations"> | ||
Due to the nature of multi index search grouping (`groupBy`) is not supported. | ||
</Aside> | ||
|
||
|
||
|
||
|