Reputation: 4097
I belive the problem is described in the question itself. I'm making a simple query:
GET /base/products
"body": {
"query": {
"filtered": {
"filter": {
"and": {
"filters": [
{
"match": {
"userId": "10"
}
}
]
}
}
}
}
}
}
But in the responses I get all the items from the database. Actually, I get that number of results provided in the "size"
property.
I'm fairly new to elasticsearch so any help is very appreciated!
Upvotes: 0
Views: 48
Reputation: 1256
You need term query, it matches exact value of a field:
{
"query": {
"term": {
"userId": "10"
}
}
}
Upvotes: 2