0

I am using parse server with MongoDB Atlas. I have an v3 index (diacritics-insensitive) implemented and it is working fine.

In Next I want to highlight text in search result. Here is a mondodb article that I want to achieve: https://docs.atlas.mongodb.com/reference/atlas-search/highlighting

But in parse server I didn't found an way to achieve this.

I can highlight text using JS preg match but preg match is not working with diacritics, so I want to utilize MongoDB Atlas highlight feature.

Thanks

Doug
  • 14,387
  • 17
  • 74
  • 104
Kishor Patidar
  • 623
  • 12
  • 23
  • I believe that's not current possible in Parse Server. Maybe you could open an issue in the open source repo. – Davi Macêdo Dec 30 '20 at 09:13
  • @DaviMacêdo Is there any alternate solution to diacritics-insensitive highlight ? or Can we use mongofb nodejs package to run a custom query? If yes then what's an ideal way to run mongodb query and connection? – Kishor Patidar Dec 30 '20 at 09:39
  • Yes. You can write a cloud code function that uses the mongodb package directly and performs the query that you need. – Davi Macêdo Dec 30 '20 at 17:27
  • @DaviMacêdo Do I need to connect mongo db each time when cloud function called or I need to make a connection when the parse server starts? – Kishor Patidar Dec 31 '20 at 06:25
  • 1
    You can create the connection in your main.js file outside the cloud code function scope. By this way the connection will be created when Parse Server starts and load the file a single time and will be used across all cloud function calls. – Davi Macêdo Dec 31 '20 at 19:16

0 Answers0