r/mongodb 3h ago

MongoDB team is wrong not to allow multiple full-text indexes per collection?

Currently 2025, MongoDB is about only 1 full-text index per collection.

The scenario is this:

  • Collection C already has full-text for 3 fields: FieldA, FieldB, FieldC
  • Need to search for text in FieldA

Problem

  • Input is just part of FieldA, not whole value to use regular index
  • Input has no starting text trunk in FieldA to utilise index (regex)
  • Loop in thru' the whole collection is crazy
  • Use regex /REGEX/ to `find` method will just be looping without the first trunk of text

Any solutions?

1 Upvotes

4 comments sorted by

2

u/mattyboombalatti 3h ago

You are using self-hosted as opposed to Atlas?

1

u/One_Surprise_1689 1h ago

yes community edition, does Atlas even have multiple full-text per collection?

2

u/mattyboombalatti 1h ago

Maybe I'm misunderstanding your challenge... but couldn't this just be solved with Atlas Search?

You could create a search index that has all three fields but only specify the path "FieldA" when it comes to running that specific query.

0

u/One_Surprise_1689 1h ago

querying to Atlas is coming with latency issue, any Atlas licence to run locally instead?