Questions tagged [pyelasticsearch]

pyelasticsearch is a clean, future-proof, high-scale python API to elasticsearch.

pyelasticsearch is a clean, future-proof, high-scale python API to elasticsearch. It provides features like...

  • Transparent conversion of Python data types to and from JSON
  • Translating HTTP status codes representing failure into exceptions
  • Connection pooling Load balancing of requests across nodes in a cluster Failed-node marking to avoid downed nodes for a period
  • Optional automatic retrying of failed requests

https://pyelasticsearch.readthedocs.io/en/latest/

89 questions
1
vote
1 answer

search array value by index in elasticsearch

i have two documents stored in elasticsearch database one is { q :["python" , "foo"] } and other is { q :["python" , "moo","foo"] } now my problem is to search document in which python is on index 0 and foo is on index 1 how to acheive…
maq
  • 1,175
  • 3
  • 17
  • 34
1
vote
1 answer

How to do bucket aggregation on multi value field in elasticsearch

Say each document in my elasticsearch index is a blog post which consists of only two fields, title and tags. The title field is just a string while tags is a multi value field. If I have three documents like this: title tags "blog1" …
user2767176
1
vote
1 answer

Matching document by ElasticSearch's Percolate API always returns no matches if registered queries contain terms

I try to use Percolator by Elasticsearch and I have a minor issue. Suppose our document looks like this: { "doc": { "full_name": "Pacman" "company": "Arcade Game LTD", "occupation": "hunter", "tags": ["Computer…
primoz
  • 885
  • 3
  • 12
  • 32
1
vote
0 answers

python elasticsearch query for boolean

I have the following query: Bool(must=[Terms(avail_req=['Available'], boost=2.0), Terms(boost=2.0, sale_rent=['Sale']), Nested(path='listings', query=Bool(should= [Terms(boost=2.0, listings.parents_id=[80]), Terms(boost=2.0, …
1
vote
0 answers

ElasticSearch: minimum_should_match and length of terms list

Using ElasticSearch I'm trying to use the minimum_should_match option on a Terms Query to find documents that have a list of longs that is X% similar to the list of longs I'm querying with. e.g: { "filter": { "fquery": { …
m_vdbeek
  • 3,704
  • 7
  • 46
  • 77
1
vote
0 answers

How to make filter aggregations using PyES

{ "aggs" : { "in_stock_products" : { "filter" : { "range" : { "stock" : { "gt" : 0 } } }, "aggs" : { "avg_price" : { "avg" : { "field" : "price" } } } } } } How to generate…
1
vote
1 answer

How to use elasticsearch to search some words from group by result?

Here is the sample data: In the type blog_comments, I have some comments data, whose structure like this: {"blog_id": 1, "comments": "Apple", "comment_id": 1} And for #1 and #2 blog, there are 6 comments in this type blog_comments…
simomo
  • 706
  • 10
  • 24
1
vote
1 answer

Using aggregation with filters in elastic search

I have an elastic search running with documents like this one: { id: 1, price: 620000, propertyType: "HO", location: { lat: 51.41999, lon: -0.14426 }, active: true, rentOrSale: "S", } I'm trying to use aggregates to get…
ip.
  • 3,306
  • 6
  • 32
  • 42
1
vote
1 answer

Aggregations group by parameters in Elasticsearch

I have documents in elasticsearch that are something like: { "numberOfBedrooms": 2, "price": 1500, "type": flat } I would like to get statistics like what is the average price by room, what is the average price by type and…
ip.
  • 3,306
  • 6
  • 32
  • 42
1
vote
1 answer

How do I get all the distinct field values that satisfy a particular query in Elasticsearch?

My sample document looks like this. { "user": "dslfjd", "productLength": 68, "productPrice": 4500, "action": "Made Purchse" } I want to get all the users that brought products whose price is between 4000 and 10000 and whose length…
syllogismos
  • 600
  • 2
  • 15
  • 39
1
vote
1 answer

Connecting to ES using python script

I am trying to connect and retrieve data from a ES engine. I am using the following script: from elasticsearch import Elasticsearch as ES print "Setup…
cartoom02
  • 89
  • 3
  • 11
1
vote
1 answer

Python Elasticsearch and Carrot

I am using python elastic search and I need to do document clustering. I have installed carrot2 ( https://github.com/carrot2/elasticsearch-carrot2 ). How do I call the carrot clustering module from python after from elasticsearch import…
Pratik Poddar
  • 1,353
  • 3
  • 18
  • 36
1
vote
0 answers

Python and Elasticsearch API changes and Autcomplete

So to begin. I am trying to add around 7.2k documents. No problem there. The issue is after I am not able to get any suggestions returned to me. So this is how the information is added: def addVariantToElasticSearch(self,docId, companyId,…
redrubia
  • 2,256
  • 6
  • 33
  • 47
1
vote
1 answer

Elastic Search HTTPConnectionPool(host='127.0.0.1', port=9200): Max retries exceeded

I have an Elastic Search server which I am querying both from a live website and through a Django management command. The management command runs using celery beat at 3am GMT to synchronise data from an outside service. Sometimes (but not every…
Prydie
  • 1,807
  • 1
  • 20
  • 30
1
vote
2 answers

ElasticSearch nested query filters and dynamic data

I have an index created using the following pyelasticsearch code: EDIT: UPDATED AGAIN 11/12/13 18:31 GMT entry_mapping = { 'product': { 'properties': { '_advertiser_id': {'type': 'integer'}, …
Prydie
  • 1,807
  • 1
  • 20
  • 30