I am using solr 4.10. I have to index poetry data in solr. Now what should be the document structure. Basically, I want to give a search facility for a term in poem. Only that specific distich should be given back. Now should I index complete poem in single document or one document per distich. I know some poems have two lines for single concept and some 4 etc. Now What should be its storing format ?
我使用的是solr 4.10。我必须在solr中索引诗歌数据。现在文档结构应该是什么。基本上,我想在诗歌中为一个术语提供一个搜索工具。只应该回馈那个特定的distich。现在我应该在单个文档中索引完整的诗或每个distich一个文档。我知道有些诗有两行单概念,有些有4等等。现在它的存储格式应该是什么?
1 个解决方案
#1
1
Index the distiches individually and link them through a poem identifier and a sequence id. That way you can also retrieve the distich before or after - or the whole poem.
单独索引distiches并通过诗标识符和序列id链接它们。这样你也可以在之前或之后或整首诗中找回distich。
If there's certain use cases that need to treat the poems as a whole instead, create a separate collection and index to both collections. That way you can adjust and tweak the search results as you need, depending on the use case.
如果某些用例需要将诗歌作为一个整体来处理,那么为两个集合创建一个单独的集合和索引。这样,您可以根据需要调整和调整搜索结果,具体取决于用例。
#1
1
Index the distiches individually and link them through a poem identifier and a sequence id. That way you can also retrieve the distich before or after - or the whole poem.
单独索引distiches并通过诗标识符和序列id链接它们。这样你也可以在之前或之后或整首诗中找回distich。
If there's certain use cases that need to treat the poems as a whole instead, create a separate collection and index to both collections. That way you can adjust and tweak the search results as you need, depending on the use case.
如果某些用例需要将诗歌作为一个整体来处理,那么为两个集合创建一个单独的集合和索引。这样,您可以根据需要调整和调整搜索结果,具体取决于用例。