Questions tagged [elasticsearch-dsl-py]

Elasticsearch DSL is a high-level Python library whose aim is to help with writing and running queries against Elasticsearch.

It provides a more convenient and idiomatic way to write and manipulate queries. It stays close to the Elasticsearch JSON DSL, mirroring its terminology and structure. It exposes the whole range of the DSL from Python either directly using defined classes or a queryset-like expressions.

It also provides an optional wrapper for working with documents as Python objects: defining mappings, retrieving and saving documents, wrapping the document data in user-defined classes.

148 questions
12
votes
1 answer

Range query in Elasticsearch_dsl by integer field

I used elasticsearch-dsl==5.2.0, elasticsearch==5.3.0 and Django==1.8.15. Django model: class Item(models.Model): price = models.DecimalField(default=0) def to_search(self): return DocItem( meta={'id': self.id}, …
tarasinf
  • 796
  • 5
  • 17
12
votes
4 answers

Unable to access ElasticSearch AWS through Python

I'm trying to access ElasticSearch AWS from my localhost through Python (I can access it through my browser). from elasticsearch import Elasticsearch ELASTIC_SEARCH_ENDPOINT = 'https://xxx' es = Elasticsearch([ELASTIC_SEARCH_ENDPOINT]) I'm…
8
votes
1 answer

Root certificates are missing for certificate validation. Either pass them in using the ca_certs parameter or install certifi to use it automatically

I am using django-elasticsearch-dsl in one of our projects, and after creating a cluster in AWS Elasticsearch, I started seeing this error: Root certificates are missing for certificate validation. Either pass them in using the ca_certs parameter or…
8
votes
1 answer

Indexing and percolating documents with elasticsearch-dsl-py

I'm making and investigation for a seminar in retrieval information. I have a json file with a list of articles and i need to index them and after use a percolator with highlighting. The list of steps for do this in terminal is this: 1. Create a…
7
votes
1 answer

Elasticsearch scoring on multiple indexes: dfs_query_then_fetch returns the same scores as query_then_fetch

I have multiple indices in Elasticsearch (and the corresponding documents in Django created using django-elasticsearch-dsl). All of the indices have these settings: settings = {'number_of_shards': 1, 'number_of_replicas':…
6
votes
1 answer

RequestError(400, u'action_request_validation_exception', u'Validation Failed: 1: type is missing;

I am following https://github.com/sabricot/django-elasticsearch-dsl to index the data inside my django-model. I have defined my documents.py file as :-> from django_elasticsearch_dsl import Document , fields from…
Prayag Bhatia
  • 366
  • 3
  • 16
6
votes
1 answer

How to aggregate until a certain value is reached in ElasticSearch?

I would like to aggregate a list of documents (each of them has two fields - timestamp and amount) by "amount" field until a certain value is reached. For example I would like to get list of documents sorted by timestamp which total amount is equal…
5
votes
2 answers

elasticsearch dsl scan results

Can someone point me to how to extract the results _source from the generator when using the scan API in the elasticsearch dsl python client? for example, i'm using (from this example, elasticsearch-dsl scan) for hit in s.scan(): print(hit) I…
4
votes
2 answers

Connecting ElasticSearch to Django using "django-elasticsearch-dsl" results in ConnectionError when attempting to create/rebuild index

I am trying to call a local ES instance running on docker. I used the following instructions to setup my ES…
cs95
  • 379,657
  • 97
  • 704
  • 746
4
votes
2 answers

Elasticsearch dsl OR query formation

I have index with multiple documents. The documents contains below fields: name adhar_number pan_number acc_number I want to create a elasticsearch dsl query. For this query two inputs are available like adhar_number and pan_number. This query…
ketan
  • 2,732
  • 11
  • 34
  • 80
3
votes
1 answer

How can I do parallel tests in Django with Elasticsearch-dsl?

Has anyone gotten parallel tests to work in Django with Elasticsearch? If so, can you share what configuration changes were required to make it happen? I've tried just about everything I can think of to make it work including the solution outlined…
3
votes
1 answer

"Failed to establish a new connection" when trying to access Elasticsearch Cloud with elasticsearch-dsl Python package

I'm experimenting with Elasticsearch and indexing some Django data using the elasticsearch-dsl Python package. I have created a relatively basic test, search.py, but receive a connection error when I try to index any data. from…
3
votes
1 answer

Elasticsearch aggregate on nested JSON data

I have to do some aggregation on json data. I saw multiple answers here on stackoverflow but not nothing worked for me. I have multiple row and in timeCountry column i have an array which stores JSON objects. with keys count, country_name, s_name. I…
3
votes
1 answer

Django Elastic Search: AttributeError: type object 'PostDocument' has no attribute 'Django'

I am very new in elasetic search in django... When i run this command, python3 manage.py search_index --rebuild it fires me this error: I am not getting whats wrong with it File…
3
votes
1 answer

Exclude phrase from search in ElasticSearch

I'm using ElasticSearch (elasticsearch-dsl) and searching for keywords, but would like to ignore some phrases from search. E.g. searching for "best" and ignore phrase "best regards": it should find document "The Best Car bla-bla-bla Best Regards"…
Alexey
  • 158
  • 3
  • 10
1
2 3
9 10