Skip to content

Commit 46c8538

Browse files
authored
cli for elastic (#662)
1 parent 0da3d88 commit 46c8538

File tree

3 files changed

+420
-0
lines changed

3 files changed

+420
-0
lines changed

README.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,96 @@ Options:
219219
--quantization-type TEXT which type of quantization to use valid values [fp32, fp16, bq]
220220
--help Show this message and exit.
221221
```
222+
### Run Elastic Cloud from command line
223+
224+
Elastic Cloud supports multiple index types: HNSW, HNSW_INT8, HNSW_INT4, and HNSW_BBQ.
225+
226+
**Example: Run HNSW index test**
227+
228+
```shell
229+
vectordbbench elasticcloudhnsw --db-label elastic-cloud-test \
230+
--cloud-id <your-cloud-id> --password '<your-password>' \
231+
--m 16 --ef-construction 100 --num-candidates 100 \
232+
--case-type Performance768D1M --number-of-shards 1 \
233+
--number-of-replicas 0 --refresh-interval 30s
234+
```
235+
236+
**Example: Run HNSW_INT8 index test**
237+
238+
```shell
239+
vectordbbench elasticcloudhnswint8 --db-label elastic-cloud-int8 \
240+
--cloud-id <your-cloud-id> --password '<your-password>' \
241+
--m 16 --ef-construction 200 --num-candidates 200 \
242+
--case-type Performance1536D50K --element-type float
243+
```
244+
245+
**Example: Run HNSW_INT4 index test**
246+
247+
```shell
248+
vectordbbench elasticcloudhnswint4 --db-label elastic-cloud-int4 \
249+
--cloud-id <your-cloud-id> --password '<your-password>' \
250+
--m 16 --ef-construction 200 --num-candidates 200 \
251+
--case-type Performance768D10M --use-rescore --oversample-ratio 2.0
252+
```
253+
254+
**Example: Run HNSW_BBQ index test**
255+
256+
```shell
257+
vectordbbench elasticcloudhnswbbq --db-label elastic-cloud-bbq \
258+
--cloud-id <your-cloud-id> --password '<your-password>' \
259+
--m 16 --ef-construction 200 --num-candidates 200 \
260+
--case-type Performance1536D5M --use-routing --use-force-merge
261+
```
262+
263+
**Example: Run Label Filter Performance test**
264+
265+
```shell
266+
vectordbbench elasticcloudhnsw --db-label elastic-cloud-label-filter \
267+
--cloud-id <your-cloud-id> --password '<your-password>' \
268+
--case-type LabelFilterPerformanceCase \
269+
--dataset-with-size-type "Medium OpenAI (1536dim, 500K)" \
270+
--label-percentage 0.001 \
271+
--m 16 --ef-construction 128 --num-candidates 100 \
272+
--num-concurrency 1,5 --number-of-shards 1
273+
```
274+
275+
To list all options for Elastic Cloud, execute `vectordbbench elasticcloudhnsw --help`. The following are Elastic Cloud-specific command-line options:
276+
277+
```text
278+
$ vectordbbench elasticcloudhnsw --help
279+
Usage: vectordbbench elasticcloudhnsw [OPTIONS]
280+
281+
Options:
282+
# Connection
283+
--cloud-id TEXT Elastic Cloud ID [required]
284+
--password TEXT Elastic Cloud password [required]
285+
286+
# HNSW Index Parameters
287+
--m INTEGER HNSW M parameter [default: 16]
288+
--ef-construction INTEGER HNSW efConstruction parameter [default: 100]
289+
--num-candidates INTEGER Number of candidates for search [default: 100]
290+
--element-type [float|byte] Element type for vectors (float: 4 bytes, byte: 1 byte) [default: float]
291+
292+
# Index Configuration
293+
--number-of-shards INTEGER Number of shards [default: 1]
294+
--number-of-replicas INTEGER Number of replicas [default: 0]
295+
--refresh-interval TEXT Index refresh interval [default: 30s]
296+
--merge-max-thread-count INTEGER
297+
Maximum thread count for merge [default: 8]
298+
--use-force-merge BOOLEAN Whether to use force merge [default: True]
299+
--use-routing BOOLEAN Whether to use routing [default: False]
300+
--use-rescore BOOLEAN Whether to use rescore [default: False]
301+
--oversample-ratio FLOAT Oversample ratio for rescore [default: 2.0]
302+
303+
# Common Options
304+
--case-type [CapacityDim128|CapacityDim960|Performance768D100M|...]
305+
Case type
306+
--db-label TEXT Db label, default: date in ISO format
307+
--k INTEGER K value for number of nearest neighbors to search [default: 100]
308+
--num-concurrency TEXT Comma-separated list of concurrency values [default: 1,5,10,20,30,40,60,80]
309+
--help Show this message and exit.
310+
```
311+
222312
### Run OceanBase from command line
223313

224314
Execute tests for the index types: HNSW, HNSW_SQ, or HNSW_BQ.
@@ -392,10 +482,23 @@ milvushnsw:
392482
ef_search: 128
393483
drop_old: False
394484
load: False
485+
elasticcloudhnsw:
486+
db_label: elastic-cloud-hnsw
487+
cloud_id: <your-cloud-id>
488+
password: <your-password>
489+
case_type: Performance768D1M
490+
m: 16
491+
ef_construction: 100
492+
num_candidates: 100
493+
number_of_shards: 1
494+
number_of_replicas: 0
495+
refresh_interval: 30s
496+
element_type: float
395497
```
396498
> Notes:
397499
> - Options passed on the command line will override the configuration file*
398500
> - Parameter names use an _ not -
501+
> - For `LabelFilterPerformanceCase` and `NewIntFilterPerformanceCase`, you must specify `dataset_with_size_type` in addition to `case_type`
399502

400503
#### Using a batch configuration file.
401504

@@ -430,10 +533,29 @@ milvushnsw:
430533
ef_search: 128
431534
drop_old: False
432535
load: False
536+
elasticcloudhnsw:
537+
- db_label: elastic-cloud-hnsw-test-1
538+
cloud_id: <your-cloud-id>
539+
password: <your-password>
540+
case_type: Performance768D1M
541+
m: 16
542+
ef_construction: 100
543+
num_candidates: 100
544+
- db_label: elastic-cloud-label-filter-0.1
545+
cloud_id: <your-cloud-id>
546+
password: <your-password>
547+
case_type: LabelFilterPerformanceCase
548+
dataset_with_size_type: "Medium OpenAI (1536dim, 500K)"
549+
label_percentage: 0.001
550+
m: 16
551+
ef_construction: 128
552+
num_candidates: 100
553+
num_concurrency: "1,5"
433554
```
434555
> Notes:
435556
> - Options can only be passed through configuration files
436557
> - Parameter names use an _ not -
558+
> - For `LabelFilterPerformanceCase` and `NewIntFilterPerformanceCase`, you must specify `dataset_with_size_type` in addition to `case_type`
437559

438560
How to use?
439561
```shell

0 commit comments

Comments
 (0)