Questions tagged [elasticsearch-aggregation]
1111 questions
0
votes
1 answer
Migrating ElasticSearch Java API FacetFilter (in early version) to simliar Aggregation in ES v5.5.3
I am migrating a Grails application using Elasticsearch Java v0.93 to version 5.5.3. One of the challenges I am facing is to migrate Facet Filter to a similar Aggregation.
Following is the code from the early version of Elasticsearch Java…

Puneet Behl
- 954
- 7
- 20
0
votes
1 answer
Kibana Visualisation Average Monthly Sums Over Years
I have these daily records.. for a period of 7 years. I managed to calculate the sum for each month and get a chart like this
I also managed to plot the sum on each month over the years.
So the first point in this second chart represents something…

Tanatos Daniel
- 558
- 2
- 9
- 27
0
votes
1 answer
Elasticsearch Term Aggregations Natural Ordering
I am making a product category page with Elasticsearch used for aggregations. As far as I know, ES can only do "_count", "_term" and by sub-aggregation for ordering the aggregation results with DSL.
My aggregation field is a string field and not…

T. Cem Yılmaz
- 500
- 9
- 30
0
votes
0 answers
date.getHourOfDay() is giving strange results in aggregation
I am indexing some events and trying to get unique hours but the terms aggregation is giving weird response . I have the following query.
{
"size": 0,
"query": {
"bool": {
"must": [
{
"terms": {
"City": [
…

RAHUL KANWAR
- 3
- 2
0
votes
1 answer
Elasticsearch aggregation group by using elastic4s
I want to query total sum of sales grouped by product name in Elasticsearch
How do I do that using elastic4s?
client.execute {
search ("sales"/ "sales_type")
.query {rangeQuery("date") gte "01-01-2018" lte "31-12-2018" }
…

9900kf
- 87
- 1
- 11
0
votes
1 answer
How to evaluate time between log messages with ElasticSearch
I want to find out how long different actions in my old PHP web-application take. There is a log-file that writes out messages when an action is started and ended. It looks like this.
LOGFILE
2018-08-13 13:05:07,217 [30813] ControllerA: actionA…

Philip Koch
- 197
- 1
- 11
0
votes
1 answer
How to count users who visited more than X times in a period
I'm trying to count active users for the service. We consider a user active if he did more than X actions in a span of a particular time period. Count will do fine, the list of user ids is not necessary.
I couldn't find the suitable query in…

chester89
- 8,328
- 17
- 68
- 113
0
votes
1 answer
Elasticsearch Terms aggregation with unknown datatype
I'm indexing data of unknown schema in Elasticsearch using dynamic mapping, i.e. we don't know the shape, datatypes, etc. of much of the data ahead of time. In queries, I want to be able to aggregate on any field. Strings are (by default) mapped as…

Todd Menier
- 37,557
- 17
- 150
- 173
0
votes
0 answers
phrase prefix query does not work
I have a simple documents that get inserted by mongodb directly, it look like this:
PUT /office_db/employee/1
{
"employeeId": "5b5fc605357d0c6",
"formalName": "mark rose",
"socialNumber": 2147483647,
"contact": {
"name": "dave more",
…

Ninja
- 85
- 7
0
votes
1 answer
How to perform search query on two different data types?
my query is very simple, for the sake of even making it simpler, lets say I only search on two fields, name(text) & age(long):
GET person_db/person/_search
{
"query": {
"bool": {
"should": [
{
"match_phrase_prefix": {
…

jack miao
- 1,398
- 1
- 16
- 32
0
votes
1 answer
When i search for document after index a document. It returns empty but it returns document with sleep of 2 seconds between creating and fetching
I am using Elasticsearch . I am trying to connect Elasticsearch with python.
I can create index with document. When i tried to fetch the same once successful creation done it returns empty.
If i make the code to sleep for 2 seconds after creating…

sangeeth kumar
- 319
- 2
- 7
- 23
0
votes
1 answer
Unique list from arrays of strings
I want a unique list of values from arrays of strings across all documents.
Example documents:
{
"_index": li",
"_type": "profile",
"_id": "tqvatGQBhAqGE7-_7pdF",
"nonarrayfield":"person A",
"attributes": [
"blah blah 123",
…

Alex Wu
- 1
- 1
0
votes
0 answers
Elasticsearch how to join publications and keywords
I have defined two indexes in elasticsearch that are populated with two different queries coming from a postgres database. I have many hundred of documents with thousand of keywords, and I have used logstash to populate the two indexes.
The first…

Nicola Lepetit
- 756
- 8
- 25
0
votes
0 answers
Remove duplicates from elastic search
I have a single index containing user information. I would like to make a search for documents matching either the NAME or EMAIL, give a count of matched documents for each and also a total count (NAME + EMAIL) with no duplicates between them. I was…

nebula186
- 119
- 2
- 14
0
votes
1 answer
How to combine multiple aggs in Elasticsearch?
I want to calculate per IP access count of each product in one day.
There are three parameters in one index(nginx-access-log):
timestamp
clientip
product_id
I know date_histogram can refer to…

Mithril
- 12,947
- 18
- 102
- 153