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
0
votes
1 answer

Nested Field Gives TypeError upon indexing in elasticsearch-dsl-py

Whenever i try to save an object that has a nested field i get a Type error. TypeError: isinstance() arg 2 must be a type or tuple of types I have following document classes: class CreationIndex(InnerDoc): created_by = Keyword() …
0
votes
1 answer

Rename doctype in elasticsearch index

I used elasticsearch-py to move millions of records represented by a Django model from PostgreSQL to Elasticsearch. I used the name of the model for doctype (which was in CamelCase). I then switched to Elasticsearch DSL and noticed that by default…
0
votes
3 answers

What are the pros and cons of using Nested mapping in Elasticsearch vs parent child relationship

Currently in my ES document structure, there is a field of type 'Object'. This is a json object which can have upto 3000 fields inside. The problem being that at times, my ES runs out of memory because of the document size being too large. So I am…
0
votes
1 answer

ElasticSearch - bulk indexing for a completion suggester in python

I am trying to add a completion suggester to enable search-as-you-type for a search field in my Django app (using Elastic Search 5.2.x and elasticseach-dsl). After trying to figure this out for a long time, I am not able to figure yet how to bulk…
0
votes
1 answer

Getting log file as it is using Elastic search

Info: Filebeat is installed on machine from where logs will be read and sent to elastic search server. From test machine, using elasticsearch-dsl, I am reading logs and writing it to file. Problem: Orig Log from machine : [Timestamp][INFO]…
0
votes
1 answer

elasticsearch dsl python unpack q queries

How can I dynamically create a combined Q query in elasticsearch dsl python? I have gone through docs and this SO post. I constructed a q_query dictionary with all required info. ipdb> q_queries {'queries': [{'status': 'PASS'}, {'status': 'FAIL'},…
0
votes
1 answer

access individual fields using elastic search dsl in python

Is the below accurate or should it be something else ? I am getting the expected results just checking if this is the most efficient way to access individual (nested) fields. from elasticsearch import Elasticsearch from elasticsearch_dsl import…
Naresh MG
  • 633
  • 2
  • 11
  • 19
0
votes
1 answer

python elasticsearch dsl search for field with white space

case 1 works but not case 2 and this is due to the white space. This is an index that has been created for sometime and used by many folks so is something wrong with my search not with the index. Perhaps it has something to do with the tokenizer or…
0
votes
1 answer

Elastic search result filter by user

I'm using elasticsearch_dsl which works great. However, I would like the results to filter according the the user token that gets sent. I tried using rest_frameworks' filters, but had no success with it. What is the right way to achieve this? URL to…
Ycon
  • 1,830
  • 3
  • 27
  • 56
0
votes
1 answer

create query on subfield (field contained in another field) using elasticsearch-dsl-py?

similar to question I want to create a query on a sub field (which is not of type nested) if data is in format "fs": { "used": 1000, "mount_point": "/" } as mentioned in answer by aaronfay I tried querying with search.query('match',…
0
votes
1 answer

Elasticsearch boolean facets returned as wrong type

I'm using ES v5.1.2 and having an issue with the facets returning incorrect types for boolean fields. Here's a minimal setup to reproduce and demonstrate the problem: from elasticsearch_dsl import DocType, FacetedSearch, TermsFacet from…
wim
  • 338,267
  • 99
  • 616
  • 750
-1
votes
1 answer

How to write a Elastic Search Query(DSL) for search using multiple fields?

I want to write an Elastic Search DSL query, where i want to display results based on input on multiple fields by a user. The user is a candidate , who is searching for a job, The job fields include fields like Job_Title, Skills, Experience,…
-1
votes
2 answers

Using variable for filter term key in elasticsearch-dsl-py

When using elasticsearch-dsl python api ,is there any way to pass a variable as key in filter . Please have a look in the code below. from elasticsearch import Elasticsearch from elasticsearch_dsl import Search es_client =…
Soumen
  • 121
  • 1
  • 3
  • 14
1 2 3
9
10