You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Changelog
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,7 @@
1
+
Version 5.3.2 2024-06
2
+
* Add support for Vector and Fulltext indexes creation
3
+
* Add DateTimeNeo4jFormatProperty for Neo4j native datetime format
4
+
1
5
Version 5.3.1 2024-05
2
6
* Add neomodel_generate_diagram script, which generates a graph model diagram based on your neomodel class definitions. Arrows and PlantUML dot options
3
7
* Fix bug in async iterator async for MyClass.nodes
The following will result in a ``ClassAlreadyDefined`` exception, because when retrieving from ``db_one``,
235
+
neomodel would not be able to decide which model to parse into ::
236
+
class GeneralPatient(AsyncStructuredNode):
237
+
__label__ = "Patient"
238
+
name = StringProperty()
239
+
240
+
class PatientOne(AsyncStructuredNode):
241
+
__label__ = "Patient"
242
+
__target_databases__ = ["db_one"]
243
+
name = StringProperty()
244
+
245
+
.. warning:: This does not prevent you from saving a node to the "wrong database". So you can still save an instance of PatientTwo to database "db_one".
246
+
247
+
193
248
``neomodel`` under multiple processes and threads
194
249
-------------------------------------------------
195
250
It is very important to realise that neomodel preserves a mapping of the set of labels associated with the Neo4J
It is important to execute this after altering the schema and observe the number of classes it reports.
35
+
36
+
Ommitting the ``--db`` argument will default to the ``NEO4J_BOLT_URL`` environment variable. This is useful for masking
37
+
your credentials.
38
+
39
+
.. note::
40
+
The script will only create indexes and constraints that are defined in your model classes. It will not remove any
41
+
existing indexes or constraints that are not defined in your model classes.
42
+
43
+
Indexes
44
+
=======
45
+
46
+
The following indexes are supported:
47
+
48
+
- ``index=True``: This will create the default Neo4j index on the property (currently RANGE).
49
+
- ``fulltext_index=FulltextIndex()``: This will create a FULLTEXT index on the property. Only available for Neo4j version 5.16 or higher. With this one, you can define the following options:
50
+
- ``analyzer``: The analyzer to use. The default is ``standard-no-stop-words``.
51
+
- ``eventually_consistent``: Whether the index should be eventually consistent. The default is ``False``.
52
+
53
+
Please refer to the `Neo4j documentation <https://neo4j.com/docs/cypher-manual/current/indexes/semantic-indexes/full-text-indexes/#configuration-settings>`_. for more information on fulltext indexes.
54
+
55
+
- ``vector_index=VectorIndex()``: This will create a VECTOR index on the property. Only available for Neo4j version 5.15 (node) and 5.18 (relationship) or higher. With this one, you can define the following options:
56
+
- ``dimensions``: The dimension of the vector. The default is 1536.
57
+
- ``similarity_function``: The similarity algorithm to use. The default is ``cosine``.
58
+
59
+
Those indexes are available for both node- and relationship properties.
60
+
61
+
.. note::
62
+
Yes, you can create multiple indexes of a different type on the same property. For example, a default index and a fulltext index.
63
+
64
+
.. note::
65
+
For the semantic indexes (fulltext and vector), this allows you to create indexes, but searching those indexes require using Cypher queries.
66
+
This is because Cypher only supports querying those indexes through a specific procedure for now.
67
+
68
+
Full example: ::
69
+
70
+
from neomodel import StructuredNode, StringProperty, FulltextIndex, VectorIndex
- ``unique_index=True``: This will create a uniqueness constraint on the property. Available for both nodes and relationships (Neo4j version 5.7 or higher).
84
+
85
+
.. note::
86
+
The uniquess constraint of Neo4j is not supported as such, but using ``required=True`` on a property serves the same purpose.
87
+
88
+
89
+
Extracting the schema from a database
90
+
=====================================
91
+
92
+
You can extract the schema from an existing database using the ``neomodel_inspect_database`` script (:ref:`inspect_database_doc`).
93
+
This script will output the schema in the neomodel format, including indexes and constraints.
0 commit comments