Text search on text index cant handle "72-506"

I’m working on a set of legal case decisions where the user is looking for statute references of the form shown in the title. 72-506 means chapter 72, paragraph 506. My query returns the entire corpus as it seems to consider “-506” as a not operation.

What would be the best way to deal with this?

Hi Ed, and welcome to the forums!

  • Could you share your index definition and the query?
  • Are you using an Atlas cloud database?

Hello Hubert,
Thanks for replying.

index def: content : text

query: cursor = decisions.find({“content”: "72-506} )