Python's official low-level client for Elasticsearch
Questions tagged [elasticsearch-py]
174 questions
0
votes
1 answer
ElasticSearch ConnectionPool using elasticsearch-py library
I am a novice in ElasticSearch, and trying to add entries to an index in ElasticSearch using concurrent connections from the ElasticSearch ConnectionPool [via the Transport class].
Here is my code:
import elasticsearch
from elasticsearch.transport…
Sameer Mirji
- 1,793
- 14
- 26
0
votes
0 answers
aggregate queries using elasticsearch-py
I'm trying the following aggregate query using elasticsearch-py version 2.1.0 to query an elasticsearch instance of version 2.1.1.
{
"query": {
"filtered": {
"filter": { "term": {"applicationType":"myapptype"} }
}
},
…
user3760679
- 31
- 3
0
votes
1 answer
Does Elasticsearch-py sanitize queries?
I'm new to ES and wondering if the search function sanitizes the inner "query" field in the body parameter when handed something like:
"query": {
"filtered": {
"query": {
"match": {
"_all": {
…
James E
- 1
- 1
0
votes
1 answer
Remove default 'match_all' query from Elasticseacrch-dsl-py
How can I remove 'match_all' from the the following query:
es = Elasticsearch()
s = Search(es)
s = s.filter("term", status="Free")
s.to_dict()
{'query': {'filtered': {'filter': {'term': {'status': 'Free'}}, 'query': {'match_all': {}}}}}
Shipra
- 1,049
- 2
- 11
- 24
0
votes
1 answer
How to get aggs in elasticsearch-dsl-py
How can I get result of an aggregation?
My code is:
s = Items.search() #Items is DSL class
s.aggs.bucket('SP', 'terms', item=item_name).metric('max_amt', 'max', field='amount')
res = s.execute()
When trying this, I'm getting following error:
…
Shipra
- 1,049
- 2
- 11
- 24
0
votes
0 answers
ElasticSearch automatic typing
I would like to search in products codes - mix of chars and numbers (for example: A210/444, Alexx 1982 X, ...). (Btw: Have anybody some best-practices for searching in this type of data?)
I have a index with index_analyzer and search_analyzer:
{
…
Dingo
- 2,426
- 1
- 17
- 14
0
votes
1 answer
Elasticsearch analyze() not compatible with Spark in Python?
I'm using the elasticsearch-py client within PySpark using Python 3 and I'm running into a problem using the analyze() function with ES in conjunction with an RDD. In particular, each record in my RDD is a string of text and I'm trying to analyze it…
plam
- 1,065
- 2
- 12
- 22
0
votes
1 answer
Getting Parse error for elasticsearch-py
I am trying to search my entire elasticsearch data for a certain word "tsbu" within a time range. When I try running this, I get a SearchParseException and Parse Failure.
es = Elasticsearch()
doc = {
"query": {
"match" : {
…
lezzago
- 241
- 1
- 6
- 15
-1
votes
1 answer
Python get data from Elasticsearch
I have a json log of modsecurity nginx. I have sent it to Elasticsearch.
Now I want write a python script to get data from Elasticsearch and use this to trigger Zabbix monitor.
But I am confused with this. Here is my data when I get it to…
nistelrooy41001662
- 756
- 1
- 13
- 41