# Filter over record... its posible

**URL:** <https://discuss.elastic.co/t/filter-over-record-its-posible/21708>\
**Category:** Elasticsearch\
**Created:** [January 19, 2015, 10:42am UTC](https://discuss.elastic.co/t/filter-over-record-its-posible/21708 "2015-01-19T10:42:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pablo3027](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@pablo3027](https://discuss.elastic.co/u/pablo3027)\
**Post date:** [January 19, 2015, 10:42am UTC](https://discuss.elastic.co/t/filter-over-record-its-posible/21708/1 "2015-01-19T10:42:43Z")

</div>

It's posible to filter by record field like cliente.cif i dont have results  
with this query but i have results if i put on a query ... thx

POST /EMPRESA-1/\_search

{  
"from" : 0,  
"size" : 500,  
"query" : {  
"filtered" : {  
"query" : {  
"bool" : {  
"minimum\_should\_match" : "100%"  
}  
},  
"filter" : {  
"and" : {  
"filters" : [ {  
"term" : {  
"idempresa" : 1  
}  
}, {  
"term" : {  
"idorganizacion" : "1"  
}  
}, {  
"term" : {  
"tipo" : "emi"  
}  
}, {  
"term" : {  
"cliente.cif" : "XXXXXX"  
}  
} ]  
}  
}  
}  
},  
"explain" : true,  
"fields" : [ "idfactura", "numero", "serie", "tipo",  
"centro.denominacion", "cliente.razonsocial", "cliente.idcliente",  
"proveedor.razonsocial", "proveedor.idproveedor", "tieneNotas",  
"tieneAttachs", "total", "fecha", "peso", "filepath", "filename",  
"firmada\_ok", "leida", "firmada", "enviada", "idmoneda" ],  
"sort" : [ {  
"fecha" : {  
"order" : "desc"  
}  
} ]  
}

--  
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/4ae22819-1eac-434d-9f87-9cf431131987%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4ae22819-1eac-434d-9f87-9cf431131987%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:38am UTC](https://discuss.elastic.co/t/filter-over-record-its-posible/21708/2 "2017-07-06T00:38:04Z")

</div>


