0

It seems there is some issue with monogdb while searching multiple phrases. I have field having value 456 ABC. When I do multiple phrase search with keyword { "$search" : "\"45\" \"ABC\"" } or { "$search" : "\"456\" \"AB\"" }, It returns document. It shouldn't return result as both phrases are not exactly matched. However if do { "$search" : "\"45\" \"AB\"" }, then it doesn't return any result.

It seems if any one phrase is exactly matched, then it gives result even other phrases matches partially.

Mahesh Bhuva
  • 744
  • 5
  • 17
  • Things like AB or 45 are considered a "fragment" and would not be matched at all. So just like "the" or "and" etc being ignored, this is intentional. You can "tune out" the stop word behavior, or simply accept that "fragments" are better suited to a $regex instead. Not an "issue" but "by design". – Neil Lunn Apr 25 '19 at 07:10
  • Ok that's not an issue, but it should not give result for `{ "$search" : "\"456\" \"AB\"" }` or `{ "$search" : "\"45\" \"ABC\"" }` – Mahesh Bhuva Apr 25 '19 at 07:23
  • No. Which is what I said when you read it. The two "short phases" are **too short**. – Neil Lunn Apr 25 '19 at 08:57
  • Is there any documentation about this behavior? How can I know which phrases will behave how? – Mahesh Bhuva Apr 25 '19 at 09:45

0 Answers0