Category : elasticsearch-dsl

I have a elasticsearch cluster with 3 nodes. here is stats output: {"_nodes": {"total": 3, "successful": 3, "failed": 0}} The index has 3 shards and 2 replicas. I use elasticsearch-dsl==7.4.0 in python django app. ELASTIC = { "hosts": ["hostname1:9200","hostname2:9200","hostname3:9200"], "timeout": 10, "max_retries": 0, } connections.configure(default=ELASTIC) sometimes save to index or search elasticsearch returnes this exception: ..

Read more

I am using elasticsearch python client to connect to elasticsearch. While trying to add mapping to index, I am getting following warning: es.indices.put_mapping(index=index, body=mappings) /usr/local/lib/python2.7/dist-packages/elasticsearch/connection/base.py:209: ElasticsearchWarning: }}], attempted to validate it with the following match_mapping_type: [string], caused by [unknown parameter [search_analyzer] on mapper [__dynamic__attributes] of type [keyword]] /usr/local/lib/python2.7/dist-packages/elasticsearch/connection/base.py:209: ElasticsearchWarning: }}], attempted to validate it with ..

Read more

I want to compare a stacktrace against other documents in the same index and look at the some relevance score to determine if it is the same error or not. For example I want to see if this error already happened Cannot remove specific attribute for ‘866e426b-4021-4ab7-b18a-082926dd6e5e’ after update If I already have a document ..

Read more

I am struggling with the Elasticsearch problem. I have set up ES Indices and using django_elasticsearch_dsl. I have tried to write tests for my application. class SearchTestMixin(object): def setup_method(self): for index in registry.get_indices(): if index.exists(): index.delete() index.create() def teardown_method(self): for index in registry.get_indices(): index.delete() And I am getting error: elasticsearch.exceptions.RequestError: RequestError(400, ‘illegal_argument_exception’, ‘[x][x.x.x.x:9300][indices:admin/create]’) How can ..

Read more

I have a field called account_number . It contains random 6 character string. I can’t seem to get python elasticsearch dsl to return just those unique values. search = Search(using=client, index=index_name).query( { "range": { "date": { "gte": "2021-08-01T08:00:00.000Z", "lte": "2021-08-31T23:59:59.599Z" #"format": "strict_date_optional_time" } } }) search.aggs.bucket("account_number","terms",field="account_number",size="1000") es_data = search.execute() Not sure if I need to ..

Read more

I am using the elasticsearch_dsl library to create an array that will filter my data in elasticsearch. I am trying to get the customer ip from a node called "Remote-Addr", with the following command: return Q(‘bool’, should=[Q(‘term’, event__information__customerBrowser__Remote-Addr=customer_ip)]) And apparently I cannot use a hyphen in the command (Remote-Addr) If I do not use it ..

Read more

I am newbie in Python Django and could not get started though I have seen basic documentations at https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl.html Here is my Elasticsearch query api for aggregation curl -X POST "localhost:9200/my_index/_search?pretty" -H ‘Content-Type: application/json’ -d’ { "aggs": { "imei_count": { "cardinality": { "field": "imei" } } } } ‘ Explanation of code block is welcome. ..

Read more