MongoDB text search with text indexes slower than using $regex
I have a shoes collection with about 1.4 millions records. I tried to get list of shoes containing “Adidas Men’s Clinch-X M Running Shoe” phrase. At first, I did not index the “name” column and perform query using $regex. Later, I tried using text indexes at “name” column and perform query using $text and $search. The result surprised me as the non-index query is much faster than text indexes query.
Normal Result
Text Indexes Result
MongoDB text search with text indexes slower than using $regex
I have a shoes collection with about 1.4 millions records. I tried to get list of shoes containing “Adidas Men’s Clinch-X M Running Shoe” phrase. At first, I did not index the “name” column and perform query using $regex. Later, I tried using text indexes at “name” column and perform query using $text and $search. The result surprised me as the non-index query is much faster than text indexes query.
Normal Result
Text Indexes Result