elasticsearch

Use AsyncElasticsearch to perform a cross-index query and get a document

Use AsyncElasticsearch to perform a cross-index query and get a document Question: I use an AsyncElasticsearch client instance in order to retrieve a document from an Elasticsearch database: doc = await client.get(index=some_index, id=some_id) Documentation is here The above is successful only when I query a specific index. If I pass a pattern such as some_index* …

Total answers: 1

Python + ElasticSearch: Mapper Parsing Exceptions for join field

Python + ElasticSearch: Mapper Parsing Exceptions for join field Question: I’m using ElasticSearch 8.3.2 to store some data I have. The data consists of metabolites and several "studies" for each metabolite, with each study in turn containing concentration values. I am also using the Python ElasticSearch client to communicate with the backend, which works fine. …

Total answers: 1

How do I use the Elasticsearch Query DSL to query an API using Python?

How do I use the Elasticsearch Query DSL to query an API using Python? Question: I’m trying to query the public Art Institute of Chicago API to only show me results that match certain criteria. For example: classification_title = "painting" colorfulness <= 13 material_titles includes "paper (fiber product)" The API documentation states: Behind the scenes, …

Total answers: 1

Removing a specific logger object in python logging

Removing a specific logger object in python logging Question: I am trying to suppress all the elasticsearch logging from my output and keep all the other logging in my code. I have tried setting elasticsearch logging level to warning as it is explained here How to set the logging level for the elasticsearch library differently …

Total answers: 1

ElasticSearch – Compile Error on Adding a Field?

ElasticSearch – Compile Error on Adding a Field? Question: Using Python, I’m trying to go row-by-row through an Elasticsearch index with 12 billion documents and add a field to each document. The field is named direction and will contain "e" for some values of the field src and "e" for others. For this particular _id, …

Total answers: 1

Elasticsearch – How to create buckets by using information from two fields at the same time?

Elasticsearch – How to create buckets by using information from two fields at the same time? Question: My documents are like this: {‘start’: 0, ‘stop’: 3, ‘val’: 3} {‘start’: 2, ‘stop’: 4, ‘val’: 1} {‘start’: 5, ‘stop’: 6, ‘val’: 4} We can imagine that each document occupies the x-coordinates from ‘start’ to ‘stop’, and has …

Total answers: 1

Elasticsearch in Python: "unknown parameter [analyser] on mapper [institution] of type [text]" when trying to create index

Elasticsearch in Python: "unknown parameter [analyser] on mapper [institution] of type [text]" when trying to create index Question: I’m trying to create my first index in Elasticsearch with Python. I keep getting errors of the type : "unknown parameter [analyser] on mapper [institution] of type [text]" or "index has not been configured in mapper" when …

Total answers: 1

elasticsearch-dsl in python: How can I return the "inner hits" for my query?

elasticsearch-dsl in python: How can I return the "inner hits" for my query? Question: I am currently exploring elasticsearch in python using the elasticsearch_dsl library. I am aware that my Elasticsearch knowledge is currently limited. I have created a model like so: class Post(InnerDoc): text = Text() id = Integer() class User(Document): name = Text() …

Total answers: 1

Elasticsearch does not work when try to use with python

Elasticsearch does not work when try to use with python Question: I am following the tutorial, completely new to any data bases, including Elasticsearch. My code client = Elasticsearch() indexName = "art" client.indices.create(index=indexName) shows the following error (according to the book, it shouldn’t) ValueError Traceback (most recent call last) /var/folders/s5/dhdrwvbj5bs4m9nld9bp43400000gn/T/ipykernel_49947/868473428.py in —-> 1 client = …

Total answers: 1

Can't create document with doc_type Elasticsearch – Python

Can't create document with doc_type Elasticsearch – Python Question: I’m new to Elastic search So im trying to create a document with specific ‘doc_type’, but when I pass in doc_type argument, I got this error: elasticsearch.exceptions.RequestError: RequestError(400, ‘no handler found for uri [/employees/teacher/1] and method [PUT]’, ‘no handler found for uri [/employees/teacher/1] and method [PUT]’) …

Total answers: 1