Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果表不相互关联,如何索引 SOLR 4.x(或更高版本)中的许多表?
或者这种方法是错误的?
例如,如果我有关于
tableShop tableProduct tableBook tableWhatever
Shop,Product并且Book相互关联,但tableWhatever不关联,但我也需要对其进行索引。
Shop
Product
Book
tableWhatever
或者也许有些书tableBook没有分配到任何一行tableShop,我怎样才能用 SOLR 索引它们???
tableBook
tableShop
这完全取决于您的商业模式。使用最新版本的 solr,您可以使用核心来分隔具有不同架构的文档。但是,文档的构成通常取决于您对实体的看法以及在该实体上的搜索方式。
在您的情况下,您可以将每个表建模为文档,并单独查询集合。如果您必须查询哪些书没有分配给它们的商店,则必须对表进行非规范化并创建一个不同的模式来组合两个表中的实体。(或 n 个表)。Solr 4.0 允许加入,但正因为如此,不要采取将关系数据库模式直接建模到 solr 模式的路线