elastic / elasticsearch-dsl-py

High level Python client for Elasticsearch
http://elasticsearch-dsl.readthedocs.org
Apache License 2.0
3.84k stars 803 forks source link

Instrumented fields in queries #1866

Closed miguelgrinberg closed 4 months ago

miguelgrinberg commented 4 months ago

Instances of InstrumentedField might pop up in queries and aggregations, for example:

s = s.query('knn', field=QuoteDoc.embedding, query_vector=model.encode(q).tolist())
s.aggs.bucket('tags', 'terms', field=QuoteDoc.tags, size=100)

With this change they are handled appropriately.