Terms aggregation for multiple fields

(Madhavan Ramachandran) #1

Hi Team,
I am new to elasticsearch and learning about the searchapi/queryapi in

I have a requirement to fetch the data from ES. My data is as below assume
in a table format

Prop-Name Type Use
Place1 Sale Office
Place2 Lease Office
Place3 SubLease Office
Place4 Sale Industry

So in type i have Sale, Lease, sublease as distinct values for the
property. Similarly for use i have 7 distinct types.

I have loaded the data as into ES. My need.. at the pageload.. i need to
showe the count of each type and each use.

Upon selection of type, i need to filter the "use" and viceversa.

Assume if we have total 30 places for Type Sale ..then the Use might have
Office15 and Industry 15..

When i select Office 15.. I need to find in the document how many types of
each belong to Office.

  1. All the time, I have to populate the distinct values (3 types and 7 use
    ) and their counts based on the selection of each
  2. How to do aggregation if the Use field having values as "Multi-family"
    and want to show as one aggregated value? Current query bring me as two
    results for this value.


You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/8f803b70-d8ff-4dbd-a4bb-0f71ecaec679%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

(system) #2