|
1 | 1 | ## latest |
2 | 2 |
|
3 | | -* **ObjectBox now supports [Vector Search](https://docs.objectbox.io/ann-vector-search)** to enable efficient similarity searches. |
4 | | - This is particularly useful for AI/ML/RAG applications, e.g. image, audio, or text similarity. Other use cases include sematic search or recommendation engines. |
5 | | - See https://docs.objectbox.io/ann-vector-search for details. |
| 3 | +**To upgrade to this major release** run `flutter pub upgrade objectbox --major-versions` |
| 4 | + (or for Dart Native apps `dart pub upgrade objectbox --major-versions`). |
6 | 5 |
|
7 | | - Create a Vector (HNSW) index for a floating point vector property. For example, a `City` with a |
8 | | - location vector: |
| 6 | +**ObjectBox now supports [Vector Search](https://docs.objectbox.io/ann-vector-search)** to enable |
| 7 | +efficient similarity searches. |
9 | 8 |
|
10 | | - ```dart |
11 | | - @Entity() |
12 | | - class City { |
13 | | - // ... |
14 | | - |
15 | | - @HnswIndex(dimensions: 2) |
16 | | - @Property(type: PropertyType.floatVector) |
17 | | - List<double>? location; |
18 | | - |
19 | | - // ... |
20 | | - } |
21 | | - ``` |
22 | | - |
23 | | - Perform a nearest neighbor search using the new `nearestNeighborsF32(queryVector, maxResultCount)` |
24 | | - query condition and the new "find with scores" query methods (the score is the distance to the |
25 | | - query vector). For example, find the 2 closest cities: |
| 9 | +This is particularly useful for AI/ML/RAG applications, e.g. image, audio, or text similarity. Other |
| 10 | +use cases include semantic search or recommendation engines. |
| 11 | + |
| 12 | +Create a Vector (HNSW) index for a floating point vector property. For example, a `City` with a |
| 13 | +location vector: |
| 14 | + |
| 15 | +```dart |
| 16 | +@Entity() |
| 17 | +class City { |
| 18 | + // ... |
| 19 | +
|
| 20 | + @HnswIndex(dimensions: 2) |
| 21 | + @Property(type: PropertyType.floatVector) |
| 22 | + List<double>? location; |
26 | 23 | |
27 | | - ```dart |
28 | | - final madrid = [40.416775, -3.703790]; |
29 | | - final query = box |
30 | | - .query(City_.location.nearestNeighborsF32(madrid, 2)) |
31 | | - .build(); |
32 | | - final closest = query.findWithScores()[0].object; |
33 | | - ``` |
| 24 | + // ... |
| 25 | +} |
| 26 | +``` |
| 27 | + |
| 28 | +Perform a nearest neighbor search using the new `nearestNeighborsF32(queryVector, maxResultCount)` |
| 29 | +query condition and the new "find with scores" query methods (the score is the distance to the |
| 30 | +query vector). For example, find the 2 closest cities: |
| 31 | + |
| 32 | +```dart |
| 33 | +final madrid = [40.416775, -3.703790]; |
| 34 | +final query = box |
| 35 | + .query(City_.location.nearestNeighborsF32(madrid, 2)) |
| 36 | + .build(); |
| 37 | +final closest = query.findWithScores()[0].object; |
| 38 | +``` |
| 39 | + |
| 40 | +For an introduction to Vector Search, more details and other supported languages see the |
| 41 | +[Vector Search documentation](https://docs.objectbox.io/ann-vector-search). |
34 | 42 |
|
35 | | - For an introduction to vector search, more details and other supported languages see the |
36 | | - [Vector Search documentation](https://docs.objectbox.io/ann-vector-search). |
37 | 43 | * The generator correctly errors when using an index on any vector type. |
38 | 44 | * Flutter for Linux/Windows, Dart Native: update to [objectbox-c 4.0.0](https://github.com/objectbox/objectbox-c/releases/tag/v4.0.0). |
39 | 45 | * Flutter for Android: update to [objectbox-android 4.0.0](https://github.com/objectbox/objectbox-java/releases/tag/V4.0.0). |
|
0 commit comments