Mapreduce with filter script?

Hi,

I would like to get a script to work like mapreduce over the results of my
query, so that if I have a query that returns 4 documents
{
brands: "brand1"
},
{
brands: "brand2"
},
{
brands: "brand2"
},
{
brands: "brand3"
}

and what I want to come out is the documents

{
brands: "brand1"
},
{
brands: "brand2"
},
{
brands: "brand3"
}

of course this is a very simplified example, and the query I am doing is
not on the brands field but it is the brands field I want to reduce / get
rid of duplicates.

thanks,
Bryan Rasmussen

--
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/f5ed9d72-8fe2-44f2-a485-7ac87cfca4df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

So do an agreggation on term = brand?

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations.html

On Wednesday, 25 February 2015 09:50:19 UTC-5, bryan rasmussen wrote:

Hi,

I would like to get a script to work like mapreduce over the results of my
query, so that if I have a query that returns 4 documents
{
brands: "brand1"
},
{
brands: "brand2"
},
{
brands: "brand2"
},
{
brands: "brand3"
}

and what I want to come out is the documents

{
brands: "brand1"
},
{
brands: "brand2"
},
{
brands: "brand3"
}

of course this is a very simplified example, and the query I am doing is
not on the brands field but it is the brands field I want to reduce / get
rid of duplicates.

thanks,
Bryan Rasmussen

--
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/d8962c18-124d-4e4c-a01e-8bca6911ec8a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.