I am using MongoDB Atlas, and my data is stored like this:
{"abc": "123"},
{"def": "456"}
]
Now, I want to create a search index on this collection with my custom analyzer. Here’s what I tried:
{
"mappings": {
"dynamic": false,
"fields": {
"*": [
{
"type": "string",
"analyzer": "keywordLowerer",
"searchAnalyzer": "standardLowerer"
}
]
},
"analyzers": [
{
"name": "standardLowerer",
"tokenizer": {
"type": "standard"
},
"tokenFilters": [
{
"type": "lowercase"
}
]
}
]
}
}
However, it is not working.
What I Tried:
Created a search index with the above configuration in MongoDB Atlas.
Used dynamic: false and mapped all fields (*) to use the keywordLowerer analyzer for indexing and standardLowerer for search.
What I Expected:
The search index to be created successfully with the custom analyzers and wildcard field.
Wicket is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1