【发布时间】:2022-01-13 13:05:48
【问题描述】:
我是 couchdb 的新手,我希望有人可以帮助我解决这个问题。
假设我有一个包含各种键的地址文档,但重要的是一个 singleLineAddress 和一个 people 数组:
{
"_id": "002cb726bfe69a79ed9b897931000ec6",
"_rev": "2-6af6d8896703e9db6f5ba97abb1ca5d7",
"type": "address",
...
"singleLineAddress": "28 CLEVEDON ROAD, WESTON-SUPER-MARE, BS23 1DG",
...
"persons":["d506d09a1c46e32f6632e6d99a0062bd","002cb726bfe69a79ed9b897931001c80"]
}
然后我有一个包含许多键的个人文档,关键是 firstName 和 lastName:
{
"_id": "d506d09a1c46e32f6632e6d99a0062bd",
"_rev": "4-98fae966a92d5c6c359cb8ddfaa487e1",
"type": "person",
...
"firstName": "Joe",
"lastName": "Bloggs"
...
}
我知道我可以创建一个链接文档视图并发出所有链接到地址的人员 ID,然后我可以使用 include_docs=true 查看所有人员数据。但是,根据我的阅读,不建议使用 include_docs=true,因为它可能很昂贵。
最终,我想使用 couchdb-lucene 使用名称和地址对 person@address 运行 FTS。这甚至可以使用链接文档吗?
【问题讨论】: