検索機能を作成していて、以下の様に書いたのですが、パフォーマンスをあげるためにはどう改善したらよいでしょうか?よろしくお願いします。
ドキュメントは1万件くらいで、8000msくらいかかっています。
lang
1queries = [ 2 { $or : [ 3 { description: { '$regex': '.*swift.*' } }, 4 { title: { '$regex': '.*swift.*' } } 5 ]}, 6 { $or : [ 7 { description: { '$regex': '.*ios.*' } }, 8 { title: { '$regex': '.*ios.*' } } 9 ]}, 10 { $or : [ 11 { description: { '$regex': '.*apple.*' } }, 12 { title: { '$regex': '.*apple.*' } } 13 ]} 14]; 15 16Event.find({ $and : queries }) 17 .select('title description url _id tag') 18 .skip(page * count) 19 .limit(count) 20 .sort({started_at: 1}) 21 .exec(function (err, events) { 22 23 if (err) { 24 console.log(err); 25 } 26 27 res.json(events); 28 29 });

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。