简体   繁体   English

在Lucene索引中存储间隔

[英]Storing intervals in the Lucene index

I have documents with the annotated zones - say, 'title', 'body', and 'comments' (zones also may be nested). 我有带注释区域的文档-例如,“标题”,“正文”和“注释”(区域也可以嵌套)。 I want to search for a word 'Obama' in the 'title' zone. 我想在“标题”区域中搜索单词“奥巴马”。 I can use a SpanQuery like word:'Obama' & zone:'title' matching at the same position, but it means that I need to store zone attribute for each word position in the document. 我可以在同一位置使用像word:'Obama' & zone:'title'匹配的SpanQuery,但这意味着我需要为文档中每个单词位置存储区域属性。 Can I just store zones as interval coordinates and then perform queries only inside those intervals? 我可以仅将区域存储为间隔坐标,然后仅在这些间隔内执行查询吗?

这似乎很混乱,但是您可以将每个单词的间隔存储为类似Dewey-Decimal的编码层次结构(请参阅我的愚蠢Lucene Tricks:层次结构 ),这将使您可以在层次结构的任何部分(所有文本,所有标题,仅标题语义等)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM