データベースに次のドキュメントがあります。
{
id: 1,
text: 'Hello I had a big grannysmith apple today and a big pear'
},
{
id: 2,
text: 'Hello I had a big apple today only'
},
{
id: 3,
text: 'Hello I had a big apple today, a big pear yesterday and a big orange today'
}
私のビューは、テキスト内の特定のキーワードの集計数を返す必要がありますが、キーワードはどのように見つけたかについて「緩い」必要があります。私のビューは次のようなものを返すはずです:
{
'grannysmith apple' : 3,
'pear': 2,
'orange': 1
}
ご覧のとおり、タグが'grannysmith apple' の場合でも、りんごを 3 回数えましたが、それでも'apples' の出現をすべてピックアップしたいと考えています。
これは可能ですか?それとも、CouchDb に挿入する前にこれを行う必要がありますか? node.js を使用して保存を実行しています - node.js で実行する必要がありますか?
前もって感謝します!