Reputation: 1
I am attempting to implement MongoDB Atlas Search within a collection named 2024 in my database. Each document in this collection is structured as follows:
{
"id": "<unique_id>",
"videoId": "<video_identifier>",
"timestamps": [
{ "time": "<timestamp>", "text": "<transcription_text>" },
{ "time": "<timestamp>", "text": "<transcription_text>" },
// ... more objects
]
// ... additional documents
}
My goal is to perform text searches on the text field within the nested timestamps array. I've configured the Atlas Search index using the lucene.nori analyzer for Korean text support. Here's my current index configuration:
{
"analyzer": "lucene.nori",
"searchAnalyzer": "lucene.nori",
"mappings": {
"dynamic": false,
"fields": {
"timestamps": {
"fields": {
"text": {
"analyzer": "lucene.nori",
"type": "string"
}
},
"type": "document"
}
}
}
}
Despite this setup, when I search for a term (e.g., "tomorrow"), the query does not filter results as expected and returns all documents. I need the query to find and count each occurrence of the term within the text fields.
Could you guide me on properly configuring my Atlas Search index for this nested array structure, and how to structure the search query to achieve the desired outcome?
My goal is to perform text searches on the text field within the nested timestamps array.
Upvotes: 0
Views: 101