【发布时间】:2015-05-26 09:32:26
【问题描述】:
假设我有一本书是这样表示的:
{ title: "Tis no book"
chapter: 1,
text: "Hello world this is a book chapter",
subchapters: [
{
chapter: 1.1
text: "Nested sub chapter"
subchapters: [
chapter: 1.1.1
text: "Nested nested..."
subchapters: [ ...etc...]
},
{
chapter: 1.2
text: "Nested sub chapter 2"
subchapters: [ ...etc...]
}
]
}
我可以使用 postgres 的 9.4 新 jsonb/gin(或其他任何东西)在此递归嵌套数据结构的 "text" 字段上设置全文索引,以便可以搜索存储到数据库中的图书库通过文本(使用索引)?
【问题讨论】:
标签: postgresql recursion