Comments (9)
Looking into it further, it seems there is a error in the documentation: https://github.com/alexklibisz/elastiknn/blame/d86eecc7bb319cd8a1d6b9aa6279f299cec2e556/docs/pages/api.md#L590
This can be easily overlooked if you copy paste from the docs, instead of reading it properly...
My query now looks like this, but still finishes with an error:
{
"query": {
"elastiknn_nearest_neighbors": {
"field": "features.color",
"vec": {
"values": [0.00784313725490196, 0.30196078431372547, 0.34901960784313724, 0.3411764705882353, 0.23137254901960785, 0.0392156862745098, 0.01568627450980392, 0.00392156862745098, 0.00392156862745098, 0.011764705882352941, 0.011764705882352941, 0.027450980392156862, 0.03137254901960784, 0.2549019607843137, 0.2549019607843137, 0.34901960784313724, 0.28627450980392155, 0.3058823529411765, 0.011764705882352941, 0.3411764705882353, 0.25098039215686274, 0.24313725490196078, 0.28627450980392155, 0.011764705882352941, 0.011764705882352941, 0.0196078431372549, 0.011764705882352941, 0.011764705882352941, 0.01568627450980392, 0.0196078431372549, 0.20392156862745098, 0.33725490196078434, 0.2823529411764706, 0.00784313725490196, 0.23921568627450981, 0.24313725490196078, 0.19215686274509805, 0.058823529411764705, 0.11764705882352941, 0.1411764705882353, 0.1843137254901961, 0.03529411764705882, 0.14901960784313725, 0.10588235294117647, 0.20392156862745098, 0.37254901960784315, 0.26666666666666666, 0.10980392156862745, 0.18823529411764706, 0.10980392156862745, 0.2784313725490196, 0.27058823529411763, 0.12549019607843137, 0.0392156862745098, 0.27058823529411763, 0.21176470588235294, 0.36470588235294116, 0.30196078431372547, 0.17647058823529413, 0.24313725490196078, 0.30196078431372547, 0.27058823529411763, 0.20392156862745098, 0.17647058823529413, 0.16470588235294117, 0.18823529411764706, 0.0784313725490196, 0.0196078431372549, 0.023529411764705882, 0.13333333333333333, 0.054901960784313725, 0.03137254901960784, 0.43137254901960786, 0.5450980392156862, 0.43529411764705883, 0.5294117647058824, 0.36470588235294116, 0.803921568627451, 0.39215686274509803, 0.403921568627451, 0.2901960784313726, 0.6627450980392157, 0.3803921568627451, 0.7568627450980392, 0.3137254901960784, 0.2823529411764706, 0.16862745098039217, 0.3607843137254902, 0.2196078431372549, 0.5019607843137255, 0.3058823529411765, 0.3137254901960784, 0.12941176470588237, 0.16862745098039217, 0.1568627450980392, 0.5803921568627451, 0.25882352941176473, 0.6705882352941176, 0.6862745098039216, 0.6705882352941176, 0.7372549019607844, 0.7450980392156863, 0.6627450980392157, 0.796078431372549, 0.9058823529411765, 0.7137254901960784, 0.8627450980392157, 0.9137254901960784]
},
"model": "lsh",
"similarity": "l2",
"candidates": 50
}
}
}
{"error":{"root_cause":[{"type":"query_shard_exception","reason":"failed to create query: { }","index_uuid":"yalL9pznRLKIkjjgwVBtiQ","index":"posts"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"posts","node":"VJH4aR0HRp6dWr3e8pReAA","reason":{"type":"query_shard_exception","reason":"failed to create query: { }","index_uuid":"yalL9pznRLKIkjjgwVBtiQ","index":"posts","caused_by":{"type":"unchecked_execution_exception","reason":"java.lang.RuntimeException: Failed to retrieve mapping at index [posts] field [features.color]","caused_by":{"type":"runtime_exception","reason":"Failed to retrieve mapping at index [posts] field [features.color]","caused_by":{"type":"","reason":"Attempt to decode value on failed cursor: DownField(type)"}}}}}]},"status":400}
from elastiknn.
@ReneHollander Hi, thanks for finding this. I had it working at one point but I actually don't have any tests for nested fields so I probably broke it at some point. I'll plan to look into this and expand the test suite soon.
from elastiknn.
Thanks, for now I moved it out and successfully ran queries on my dataset.
Are you also on planning to write some docs on how to select values for rows
, bands
and width
? I know that the docs mention in which way query performance will go for increasing/decreasing values. Especially how they relate to the size of your dataset. I basically tried it with the values in the API Example, and inserted around 3M documents. Queries took around 5 to 10 seconds on one node (-Xmx2048M for elasticsearch). Not sure if I can exepct more on one node, or if I can achieve better with more tuning. It may make sense to open another issue for that to help others get a quick start with selecting appropriate values :)
from elastiknn.
from elastiknn.
@ReneHollander Also quick note on performance: the general unit of parallelism in Elasticsearch is the shard. Latency should be roughly proportional to the number of shards in your index (i.e. 5 shards is ~5x faster than 1 shard, assuming you have >= 5 threads). Eventually you will want to spread shards across nodes for replication and further parallelism.
from elastiknn.
Thanks for the reminder with the sharding. After setting it properly things got much better.
After that I put together a python script over two days I let it run over different combinations of bands, rows and width and got a good result that achieves around 100ms latency with almost perfect recall and precision.
from elastiknn.
from elastiknn.
For now I have just used called the REST API directly, as I did the testing manually at first, and then built the script from there.
The application I intend to use this in is in Python, so I will likely use it when I get o that stage.
from elastiknn.
This is fixed in #106 .
@ReneHollander If you're still using the plugin, please have a look at the latest release.
Thanks!
from elastiknn.
Related Issues (20)
- Plugin [.installing-18148280304972249747] is missing a descriptor properties file HOT 1
- Run benchmarks in Github Actions on a standalone EC2 instance HOT 1
- Try vectors from Project Panama for LSH operations HOT 3
- can't create a mapping HOT 1
- Try quick select algorithm for KthGreatest implementation HOT 4
- Try resampling vectors to speed up L2LshModel
- Try getting rid of HashAndFreq to minimize allocations HOT 1
- Try re-using threadlocal arrays in ArrayHitCounter HOT 2
- Try caching the query vector's FloatVector segments when computing distance HOT 2
- Get Fashion Mnist 96% recall up to 200 queries/second HOT 2
- Try using a byte array in ArrayHitCounter instead of a short array
- Try Lucene VectorUtil instead/alongside PanamaFloatVectorOps HOT 1
- Try index sorting to reduce number of shards/segments accessed HOT 2
- Kibana does not show the data of elastiknn_sparse_bool_vector HOT 1
- Q&A: Scale effects HOT 2
- Support range queries (neighbors within some distance) HOT 1
- Try using Lucene IntIntHashMap to speedup and reduce memory usage of top-K counting HOT 1
- Hope to support version 7.17.20, later 7.17.x can be downloaded HOT 1
- a problem about hybrid search HOT 3
- cannot create runtime field during seach HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elastiknn.