I want to search two keywords in the collections with text indexes. Let’s say the two words are 1) Girls’ Generation 2) 소녀시대. If I search like this
{
$match:{
$text:
{
$search: "Girls' Generation 소녀시대"
}
}
}
This match all documents with consist of “Girls” keyword, not exact to “Girls’ Generation”.So,If I change to this
{
$match:{
$text:
{
$search: "\"Girls' Generation\" 소녀시대"
}
}
}
This match only documents with “Girls’ Generation” keyword. korean keyword “소녀시대” are not considered. So I change to this
{
$match:{
$text:
{
$search: "\"Girls' Generation\" \"소녀시대\""
}
}
}
This match only documents with both two keywords exists. This doesn’t work if only one keywords exists. Is there any fix which search one of the exact pharases?