Please advise the best solution for full-text search in mongoDB

Documents in my database have names and descriptions among other fields. I would like to allow users to search for these documents by providing a few keywords. Keywords should be used to search both in the name and in the description field. I read the mongoDB full-text search documentation, and it looks very nice and simple if I want to search for keywords in the name field of my documents. However, the description field contains free-form text and can take up to 2,000 characters, so there may be several hundred words per document. I could treat them the same way as names, and just split the entire description into separate words and save it as another array similar to a tag (according to Mongo's example), but this seems like a terrible idea - each document size can be almost doubled, plus there are symbols such as periods, commas, etc.

I know that there are special solutions for such problems, and I just looked at Lucene.Net, I also saw what Sol mentioned here and there.

Should I look for an implementation of this search function in mongoDB or use a specialized solution? Currently, I have only one mongod instance and one web server instance. We may need to scale later, but for now that's all I use. I would appreciate any suggestions on how to implement this feature.

+3
source share
2 answers

If storing the split text in an array for a documented approach is not viable (I can understand your problems), then I think you should study a specialized solution.

Quote from MongoDB documentation:

MongoDB has interesting functionality that makes certain search functions easy. However, this is not a full-text search engine.

, , . , , , , :

  • MongoDB?
  • / ?
  • MongoDB ?
  • , MongoDB ( )
+1

. . "" .

+1

All Articles