mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
update workload example and documentation
This commit is contained in:
@@ -24,7 +24,7 @@ blocks:
|
||||
ops:
|
||||
# Reference: https://support.neo4j.com/s/article/360059882854-Deleting-large-numbers-of-nodes#h_01H95CXNJ8TN4126T3Y01BRWKS
|
||||
delete_nodes:
|
||||
autocommit: |
|
||||
sync_autocommit: |
|
||||
MATCH (n)
|
||||
CALL { WITH n
|
||||
DETACH DELETE n
|
||||
@@ -32,14 +32,14 @@ blocks:
|
||||
query_params:
|
||||
delete_batch_size: TEMPLATE(delete_batch_size,5000)
|
||||
drop_index:
|
||||
autocommit: DROP INDEX $index_name IF EXISTS
|
||||
sync_autocommit: DROP INDEX $index_name IF EXISTS
|
||||
query_params:
|
||||
index_name: vector_index
|
||||
|
||||
schema:
|
||||
ops:
|
||||
create_vector_index:
|
||||
autocommit: |
|
||||
sync_autocommit: |
|
||||
CREATE VECTOR INDEX $index_name IF NOT EXISTS FOR (n:TEMPLATE(node_label,Node))
|
||||
ON (n.embedding) OPTIONS
|
||||
{indexConfig: {`vector.dimensions`: $dimension, `vector.similarity_function`: $similarity_function}}
|
||||
@@ -51,7 +51,7 @@ blocks:
|
||||
rampup:
|
||||
ops:
|
||||
insert_node:
|
||||
write_transaction: |
|
||||
async_write_transaction: |
|
||||
CREATE (v:TEMPLATE(node_label,Node) {id: $id, embedding: $vector})
|
||||
query_params:
|
||||
id: '{id}'
|
||||
@@ -61,7 +61,7 @@ blocks:
|
||||
ops:
|
||||
# Reference: https://community.neo4j.com/t/unwind-multiple-arrays-to-set-property/59908/5
|
||||
insert_nodes:
|
||||
write_transaction: |
|
||||
async_write_transaction: |
|
||||
WITH $id_list as ids, $vector_list as vectors
|
||||
UNWIND RANGE(0, size(ids) - 1) as idx
|
||||
CREATE (v:TEMPLATE(node_label,Node) {id: ids[idx], embedding: vectors[idx]})
|
||||
@@ -72,7 +72,7 @@ blocks:
|
||||
search:
|
||||
ops:
|
||||
search:
|
||||
read_transaction: |
|
||||
async_read_transaction: |
|
||||
WITH $query_vector AS queryVector
|
||||
CALL db.index.vector.queryNodes($index_name, $k, queryVector)
|
||||
YIELD node
|
||||
|
||||
@@ -13,10 +13,13 @@ instance of the Neo4J/Aura database:
|
||||
|
||||
## Op Templates
|
||||
|
||||
The Neo4J adapter supports three different op types:
|
||||
- autocommit
|
||||
- read_transaction
|
||||
- write_transaction
|
||||
The Neo4J adapter supports six different op types:
|
||||
- sync_autocommit
|
||||
- async_autocommit
|
||||
- sync_read_transaction
|
||||
- async_read_transaction
|
||||
- sync_write_transaction
|
||||
- async_write_transaction
|
||||
|
||||
A good reference for when to use each is located at https://neo4j.com/docs/driver-manual/1.7/sessions-transactions/
|
||||
|
||||
@@ -32,7 +35,7 @@ vector search functionality has been properly worked through, currently.
|
||||
```yaml
|
||||
ops:
|
||||
example_create_vector_index:
|
||||
autocommit: |
|
||||
sync_autocommit: |
|
||||
CREATE VECTOR INDEX $index_name IF NOT EXISTS FOR (n:TEMPLATE(node_label,Node))
|
||||
ON (n.embedding) OPTIONS
|
||||
{indexConfig: {`vector.dimensions`: $dimension, `vector.similarity_function`: $similarity_function}}
|
||||
@@ -42,14 +45,14 @@ ops:
|
||||
similarity_function: TEMPLATE(similarity_function,cosine)
|
||||
|
||||
example_insert_node:
|
||||
write_transaction: |
|
||||
async_write_transaction: |
|
||||
CREATE (v:TEMPLATE(node_label,Node) {id: $id, embedding: $vector})
|
||||
query_params:
|
||||
id: '{id}'
|
||||
vector: '{train_vector}'
|
||||
|
||||
example_search:
|
||||
read_transaction: |
|
||||
async_read_transaction: |
|
||||
WITH $query_vector AS queryVector
|
||||
CALL db.index.vector.queryNodes($index_name, $k, queryVector)
|
||||
YIELD node
|
||||
|
||||
Reference in New Issue
Block a user