milvus
milvus copied to clipboard
feat: support json index
https://github.com/milvus-io/milvus/issues/35528
This PR adds json index support for json and dynamic fields. Now you can only do unary query like 'a["b"] > 1' using this index. We will support more filter type later.
basic usage:
collection.create_index("json_field", {"index_type": "INVERTED",
"params": {"json_cast_type": DataType.STRING, "json_path":
'json_field["a"]["b"]'}})
There are some limits to use this index:
- If a record does not have the json path you specify, it will be ignored and there will not be an error.
- If a value of the json path fails to be cast to the type you specify, it will be ignored and there will not be an error.
- A specific json path can have only one json index.
- If you try to create more than one json indexes for one json field, sdk(pymilvus<=2.4.7) may return immediately because of internal implementation. This will be fixed in a later version.
@sunby Please associate the related issue to the body of your Pull Request. (eg. “issue: #
@sunby go-sdk check failed, comment rerun go-sdk can trigger the job again.
@sunby E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.
@sunby go-sdk check failed, comment rerun go-sdk can trigger the job again.
@sunby go-sdk check failed, comment rerun go-sdk can trigger the job again.
@sunby go-sdk check failed, comment rerun go-sdk can trigger the job again.
Codecov Report
Attention: Patch coverage is 78.52029% with 90 lines in your changes missing coverage. Please review.
Project coverage is 80.08%. Comparing base (
53a4207) to head (49435e8). Report is 30 commits behind head on master.
:x: Your patch status has failed because the patch coverage (78.52%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.
Additional details and impacted files
@@ Coverage Diff @@
## master #36750 +/- ##
==========================================
- Coverage 80.10% 80.08% -0.03%
==========================================
Files 1482 1490 +8
Lines 205063 206217 +1154
==========================================
+ Hits 164275 165144 +869
- Misses 34886 35098 +212
- Partials 5902 5975 +73
| Components | Coverage Δ | |
|---|---|---|
| Client | 79.24% <ø> (-0.04%) |
:arrow_down: |
| Core | 69.50% <80.00%> (+0.11%) |
:arrow_up: |
| Go | 81.79% <76.53%> (-0.05%) |
:arrow_down: |
| Files with missing lines | Coverage Δ | |
|---|---|---|
| internal/core/src/bitset/common.h | 94.11% <100.00%> (ø) |
|
| internal/core/src/common/FieldDataInterface.h | 56.76% <100.00%> (+1.34%) |
:arrow_up: |
| internal/core/src/common/FieldMeta.h | 94.82% <ø> (ø) |
|
| ...e/src/exec/expression/BinaryArithOpEvalRangeExpr.h | 100.00% <100.00%> (ø) |
|
| ...nternal/core/src/exec/expression/BinaryRangeExpr.h | 94.00% <100.00%> (ø) |
|
| internal/core/src/exec/expression/ExistsExpr.h | 100.00% <100.00%> (ø) |
|
| internal/core/src/exec/expression/Expr.h | 70.00% <100.00%> (+0.71%) |
:arrow_up: |
| ...ternal/core/src/exec/expression/JsonContainsExpr.h | 100.00% <100.00%> (ø) |
|
| internal/core/src/exec/expression/NullExpr.h | 100.00% <100.00%> (ø) |
|
| internal/core/src/exec/expression/TermExpr.h | 85.71% <100.00%> (ø) |
|
| ... and 27 more |
@sunby E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.
@sunby
Are you done with this feature so I can start to review it?
@sunby E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.
@sunby go-sdk check failed, comment rerun go-sdk can trigger the job again.
@sunby cpp-unit-test check failed, comment rerun cpp-unit-test can trigger the job again.
@sunby E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.
@sunby go-sdk check failed, comment rerun go-sdk can trigger the job again.
@sunby cpp-unit-test check failed, comment rerun cpp-unit-test can trigger the job again.
@sunby cpp-unit-test check failed, comment rerun cpp-unit-test can trigger the job again.
@sunby go-sdk check failed, comment rerun go-sdk can trigger the job again.
@sunby E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.
@sunby E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.
@sunby go-sdk check failed, comment rerun go-sdk can trigger the job again.
@sunby cpp-unit-test check failed, comment rerun cpp-unit-test can trigger the job again.
@sunby go-sdk check failed, comment rerun go-sdk can trigger the job again.
@sunby E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.
@sunby go-sdk check failed, comment rerun go-sdk can trigger the job again.
@sunby E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.
@sunby E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.
@sunby cpp-unit-test check failed, comment rerun cpp-unit-test can trigger the job again.
@sunby E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.
@sunby E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.
@sunby E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.