I'm trying to run a multi_match nested query using javascript and opensearch. Here is what the query looks like:
const { body } = await client.search({
index,
body: {
size: 25,
query: {
nested: {
path: "questions",
query: {
multi_match: {
query: searchText,
fields: ["question", "comments", "label", "user_answer"],
},
},
},
},
},
});
and here is my schema:
questions: {
type: "nested",
properties: {
question: { type: "text" },
comments: { type: "text" },
label: { type: "text" },
user_answer: { type: "text" },
},
}
I have other queries that are working properly and the actual search is just returning no hits, so I know the problem isn't with opensearch and the setup. It seems that I just am doing the query wrong? Any help on this would be greatly appreciated, I can't find examples on SO that work in my case and the documentation isn't helping me much with this issue.