# Facte Query

**URL:** <https://discuss.elastic.co/t/facte-query/14972>\
**Category:** Elasticsearch\
**Created:** [December 20, 2013, 9:19am UTC](https://discuss.elastic.co/t/facte-query/14972 "2013-12-20T09:19:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![paul1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul1/32/46819_2.png) [@paul1](https://discuss.elastic.co/u/paul1)\
**Post date:** [December 20, 2013, 9:19am UTC](https://discuss.elastic.co/t/facte-query/14972/1 "2013-12-20T09:19:37Z")

</div>

Ned to club facets , i.e i am faceting for sports on multiple fields  
"menVaritySports" and "womenVaritySports"

result is :

Basketball - 3  
Golf - 2  
Baseball - 2

It should be Basketball - 2 i.e it should consider one "Basketball" if it  
comes under both men and women. is it possible to do that way.

## Data 1

## {"sports":{ "menVaritySports":["Baseball", "Basketball"], "womenVaritySports":["Basketball", "Golf"] } } Data 2

{"sports":{  
"menVaritySports":[  
"Baseball",  
"Basketball"  
],  
"womenVaritySports":[  
"Golf"  
]  
}  
}

## QUERY:

{  
"query":{  
"match\_all":{

```
  }

```

},  
"facets":{  
"sports":{  
"terms":{  
"fields":[  
"sports.menVaritySports.facet",  
"sports.womenVaritySports.facet"  
]  
}  
}  
}  
}

## MAPPING:

{  
"mappings":{  
"university":{  
"properties":{  
"sports":{  
"properties":{  
"menVaritySports":{  
"type":"multi\_field",  
"fields":{  
"menVaritySports":{  
"type":"string"  
},  
"facet":{  
"type":"string",  
"index":"not\_analyzed"  
}  
}  
},  
"womenVaritySports":{  
"type":"multi\_field",  
"fields":{  
"womenVaritySports":{  
"type":"string"  
},  
"facet":{  
"type":"string",  
"index":"not\_analyzed"  
}  
}  
}  
}  
}  
}  
}  
}  
}

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/25916485-4576-47e0-aee0-735cd33ddefb%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/25916485-4576-47e0-aee0-735cd33ddefb%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:00am UTC](https://discuss.elastic.co/t/facte-query/14972/2 "2017-07-06T02:00:02Z")

</div>

Closed on July 6, 2017, 2:00am UTC


