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.
我正在使用 Lucene 的 eXist 实现。例如,是否有一个查询可以让我找到<span>A</span> B文档中所有出现的 ?即,所有Bs 出现在 1 个单词内<span>A</span>,但没有包含在它们自己的元素中?
<span>A</span> B
B
<span>A</span>
这个 XPath 应该可以解决问题:
//span[. = 'A'][following-sibling::node()[1] = ' B']
这并没有使用 eXist 的基于 Lucene 的全文索引,但是您还没有说您是否在此处对 span 元素应用了索引。如果挑战还有其他方面,请告诉我。