So I'm using Gentics Mesh and a "middleware". From this middleware, I'm making a request to the mesh
API that forwards requests to elasticSearch
. At moment I don't want to use GraphQL API so that's why I'm using /rawSearch
.
The problem becomes that in such query it will query all indices and I would like to decide which one it queries, just like elasticSearch
does, for example, /index1,index2/_search.
Is it possible to limit the search to specific indexes or am I forced to use GraphQL?
Asked
Active
Viewed 87 times
0

Andrew K.
- 3,240
- 12
- 23

Javier Velando
- 3
- 2
1 Answers
0
It is not possible to provide the exact index name yourself.
Maybe it useful for your use case to use the /api/v2/:projectName/rawSearch
which narrows the indices down to a certain project within mesh.

PGuertler
- 243
- 1
- 2
- 6
-
Mesh creates 2 index per schema, draft and published, by your approach I will narrow the query but it will still query for all *-draft indices even if I want only to query *-published ones. – Javier Velando Feb 25 '20 at 14:26
-
@JavierVelando That's not correct. Mesh will search in either -draft or -published indices (depending on ?version query parameter) – Jotschi Feb 25 '20 at 18:35
-
@Jotschi Thank you very much. But I couldn't find this info in the docs. https://getmesh.io/docs/api/#rawSearch_nodes_post Just btw can you confirm that queries cant be done against only certain schemas (indices)? – Javier Velando Feb 26 '20 at 08:02
-
@JavierVelando Yes, queries are always run against all schemas. We already plan to optimize this by adding a filter query parameter. This way only specific indices would be hit. (e.g. schemas=content,folder). Thanks for the feedback. We'll update the docs. – Jotschi Feb 26 '20 at 09:38