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:
|
ops:
|
||||||
# Reference: https://support.neo4j.com/s/article/360059882854-Deleting-large-numbers-of-nodes#h_01H95CXNJ8TN4126T3Y01BRWKS
|
# Reference: https://support.neo4j.com/s/article/360059882854-Deleting-large-numbers-of-nodes#h_01H95CXNJ8TN4126T3Y01BRWKS
|
||||||
delete_nodes:
|
delete_nodes:
|
||||||
autocommit: |
|
sync_autocommit: |
|
||||||
MATCH (n)
|
MATCH (n)
|
||||||
CALL { WITH n
|
CALL { WITH n
|
||||||
DETACH DELETE n
|
DETACH DELETE n
|
||||||
@@ -32,14 +32,14 @@ blocks:
|
|||||||
query_params:
|
query_params:
|
||||||
delete_batch_size: TEMPLATE(delete_batch_size,5000)
|
delete_batch_size: TEMPLATE(delete_batch_size,5000)
|
||||||
drop_index:
|
drop_index:
|
||||||
autocommit: DROP INDEX $index_name IF EXISTS
|
sync_autocommit: DROP INDEX $index_name IF EXISTS
|
||||||
query_params:
|
query_params:
|
||||||
index_name: vector_index
|
index_name: vector_index
|
||||||
|
|
||||||
schema:
|
schema:
|
||||||
ops:
|
ops:
|
||||||
create_vector_index:
|
create_vector_index:
|
||||||
autocommit: |
|
sync_autocommit: |
|
||||||
CREATE VECTOR INDEX $index_name IF NOT EXISTS FOR (n:TEMPLATE(node_label,Node))
|
CREATE VECTOR INDEX $index_name IF NOT EXISTS FOR (n:TEMPLATE(node_label,Node))
|
||||||
ON (n.embedding) OPTIONS
|
ON (n.embedding) OPTIONS
|
||||||
{indexConfig: {`vector.dimensions`: $dimension, `vector.similarity_function`: $similarity_function}}
|
{indexConfig: {`vector.dimensions`: $dimension, `vector.similarity_function`: $similarity_function}}
|
||||||
@@ -51,7 +51,7 @@ blocks:
|
|||||||
rampup:
|
rampup:
|
||||||
ops:
|
ops:
|
||||||
insert_node:
|
insert_node:
|
||||||
write_transaction: |
|
async_write_transaction: |
|
||||||
CREATE (v:TEMPLATE(node_label,Node) {id: $id, embedding: $vector})
|
CREATE (v:TEMPLATE(node_label,Node) {id: $id, embedding: $vector})
|
||||||
query_params:
|
query_params:
|
||||||
id: '{id}'
|
id: '{id}'
|
||||||
@@ -61,7 +61,7 @@ blocks:
|
|||||||
ops:
|
ops:
|
||||||
# Reference: https://community.neo4j.com/t/unwind-multiple-arrays-to-set-property/59908/5
|
# Reference: https://community.neo4j.com/t/unwind-multiple-arrays-to-set-property/59908/5
|
||||||
insert_nodes:
|
insert_nodes:
|
||||||
write_transaction: |
|
async_write_transaction: |
|
||||||
WITH $id_list as ids, $vector_list as vectors
|
WITH $id_list as ids, $vector_list as vectors
|
||||||
UNWIND RANGE(0, size(ids) - 1) as idx
|
UNWIND RANGE(0, size(ids) - 1) as idx
|
||||||
CREATE (v:TEMPLATE(node_label,Node) {id: ids[idx], embedding: vectors[idx]})
|
CREATE (v:TEMPLATE(node_label,Node) {id: ids[idx], embedding: vectors[idx]})
|
||||||
@@ -72,7 +72,7 @@ blocks:
|
|||||||
search:
|
search:
|
||||||
ops:
|
ops:
|
||||||
search:
|
search:
|
||||||
read_transaction: |
|
async_read_transaction: |
|
||||||
WITH $query_vector AS queryVector
|
WITH $query_vector AS queryVector
|
||||||
CALL db.index.vector.queryNodes($index_name, $k, queryVector)
|
CALL db.index.vector.queryNodes($index_name, $k, queryVector)
|
||||||
YIELD node
|
YIELD node
|
||||||
|
|||||||
@@ -13,10 +13,13 @@ instance of the Neo4J/Aura database:
|
|||||||
|
|
||||||
## Op Templates
|
## Op Templates
|
||||||
|
|
||||||
The Neo4J adapter supports three different op types:
|
The Neo4J adapter supports six different op types:
|
||||||
- autocommit
|
- sync_autocommit
|
||||||
- read_transaction
|
- async_autocommit
|
||||||
- write_transaction
|
- 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/
|
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
|
```yaml
|
||||||
ops:
|
ops:
|
||||||
example_create_vector_index:
|
example_create_vector_index:
|
||||||
autocommit: |
|
sync_autocommit: |
|
||||||
CREATE VECTOR INDEX $index_name IF NOT EXISTS FOR (n:TEMPLATE(node_label,Node))
|
CREATE VECTOR INDEX $index_name IF NOT EXISTS FOR (n:TEMPLATE(node_label,Node))
|
||||||
ON (n.embedding) OPTIONS
|
ON (n.embedding) OPTIONS
|
||||||
{indexConfig: {`vector.dimensions`: $dimension, `vector.similarity_function`: $similarity_function}}
|
{indexConfig: {`vector.dimensions`: $dimension, `vector.similarity_function`: $similarity_function}}
|
||||||
@@ -42,14 +45,14 @@ ops:
|
|||||||
similarity_function: TEMPLATE(similarity_function,cosine)
|
similarity_function: TEMPLATE(similarity_function,cosine)
|
||||||
|
|
||||||
example_insert_node:
|
example_insert_node:
|
||||||
write_transaction: |
|
async_write_transaction: |
|
||||||
CREATE (v:TEMPLATE(node_label,Node) {id: $id, embedding: $vector})
|
CREATE (v:TEMPLATE(node_label,Node) {id: $id, embedding: $vector})
|
||||||
query_params:
|
query_params:
|
||||||
id: '{id}'
|
id: '{id}'
|
||||||
vector: '{train_vector}'
|
vector: '{train_vector}'
|
||||||
|
|
||||||
example_search:
|
example_search:
|
||||||
read_transaction: |
|
async_read_transaction: |
|
||||||
WITH $query_vector AS queryVector
|
WITH $query_vector AS queryVector
|
||||||
CALL db.index.vector.queryNodes($index_name, $k, queryVector)
|
CALL db.index.vector.queryNodes($index_name, $k, queryVector)
|
||||||
YIELD node
|
YIELD node
|
||||||
|
|||||||
Reference in New Issue
Block a user