I have this document structure:
{
"_index": "catalogue",
"_type": "attribute",
"_id": "f26f19bb-5558-4e01-a021-d81cd895248d",
"_score": 1,
"_source": {
"id": "f26f19bb-5558-4e01-a021-d81cd895248d",
"tenantIds": [
"1",
"2"
]
}
}
I am making a query that returns all the document that contain certain tenant.
I looks like (In Sense plugin):
POST /catalogue/attribute/_search
{
"filter": {"terms": {
"tenantIds": [
"1"
]
}}
}
The problem is when i try to implement in elastic search scala plugin - for eclipse, i get issues and cannot create the query and filter, and i cant find a descent guide.
What i try and get no response is:
val tenantIdFilter = FilterBuilders.termFilter("tenantIds",tenantId.get+",all")
val totalQuery = IndexQuery[AttributeSearchItem]().withBuilder(QueryBuilders.filteredQuery(QueryBuilders.boolQuery(),tenantIdFilter))
val newProducts = this.search(totalQuery)
I get empty results. What am I doing wrong ?
Thanks