opendistro-for-elasticsearch / k-NN

🆕 A machine learning plugin which supports an approximate k-NN search algorithm for Open Distro.
https://opendistro.github.io/
Apache License 2.0
277 stars 55 forks source link

Add existsQuery method implementation to KNNVectorFieldType #228

Closed jmazanec15 closed 4 years ago

jmazanec15 commented 4 years ago

Issue #, if available:

197

Description of changes: Adds existQuery functionality support to KNNVectorFieldType.

This change allows a user to get the documents with a k-NN field like this:

{
    "query": {
       "exists": {
       "field": "imageVector"
     }
  }
}

Additionally, added tests to confirm functionality.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

codecov[bot] commented 4 years ago

Codecov Report

Merging #228 into master will increase coverage by 0.33%. The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #228      +/-   ##
============================================
+ Coverage     77.61%   77.95%   +0.33%     
- Complexity      308      310       +2     
============================================
  Files            50       50              
  Lines          1193     1193              
  Branches        101      101              
============================================
+ Hits            926      930       +4     
+ Misses          219      215       -4     
  Partials         48       48              
Impacted Files Coverage Δ Complexity Δ
...relasticsearch/knn/index/KNNVectorFieldMapper.java 80.00% <100.00%> (+0.71%) 17.00 <0.00> (ø)
...index/codec/KNN80Codec/KNN80DocValuesConsumer.java 68.35% <0.00%> (+2.53%) 13.00% <0.00%> (+1.00%)
...csearch/knn/index/codec/KNN86Codec/KNN86Codec.java 95.00% <0.00%> (+5.00%) 13.00% <0.00%> (+1.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 698c2d8...635dac9. Read the comment docs.