Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
<img src="//i.stack.imgur.com/RUiNP.png" height="16" width="18" alt="" class="sponsor tag img">elasticsearch 如何索引html内容,保持位置(如xpath、css选择器等)_<img Src="//i.stack.imgur.com/RUiNP.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch_Solr_Lucene - Fatal编程技术网 elasticsearch 如何索引html内容,保持位置(如xpath、css选择器等),elasticsearch,solr,lucene,elasticsearch,Solr,Lucene" /> elasticsearch 如何索引html内容,保持位置(如xpath、css选择器等),elasticsearch,solr,lucene,elasticsearch,Solr,Lucene" />

elasticsearch 如何索引html内容,保持位置(如xpath、css选择器等)

elasticsearch 如何索引html内容,保持位置(如xpath、css选择器等),elasticsearch,solr,lucene,elasticsearch,Solr,Lucene,我想为HTML内容创建全文搜索索引(更具体地说:XHTML格式的EPUB章节)。像这样: ... <p>Lorem ipsum <b>dolor</b> sit amet, consectetur adipiscing elit.</p> ... 标准场景(我在任何地方都能找到)如带过滤器的stripHTML字符,然后标记化等等,在这里不适用,因为它在第一步中丢失了位置信息 有什么建议吗?这在Solr或ElasticSearch中可能吗?谢谢 您

我想为HTML内容创建全文搜索索引(更具体地说:XHTML格式的EPUB章节)。像这样:

...
<p>Lorem ipsum <b>dolor</b> sit amet, consectetur adipiscing elit.</p>
...
标准场景(我在任何地方都能找到)如带过滤器的stripHTML字符,然后标记化等等,在这里不适用,因为它在第一步中丢失了位置信息


有什么建议吗?这在Solr或ElasticSearch中可能吗?谢谢

您的问题是关于xhtml文档突出显示后的xpath

我不知道solr或elasticsearch中是否有正在运行的解决方案。在('XTF')中有一些非常类似的东西,它构建在Lucene(旧版本)的基础上。 在XTF中,您可以在原始xml文件中获取。因此,编写xsl转换来生成相应的XPath应该很容易


简言之,主要思想是将EPUB书籍分割成重叠的块,并将xml结构作为特殊字符存储在索引和存储字段中。通过突出显示信息,您可以重新转换原始xml结构以查找xpath。

您的问题是关于xhtml文档突出显示后的xpath

我不知道solr或elasticsearch中是否有正在运行的解决方案。在('XTF')中有一些非常类似的东西,它构建在Lucene(旧版本)的基础上。 在XTF中,您可以在原始xml文件中获取。因此,编写xsl转换来生成相应的XPath应该很容易

简言之,主要思想是将EPUB书籍分割成重叠的块,并将xml结构作为特殊字符存储在索引和存储字段中。通过突出显示信息,您可以重新转换原始xml结构以查找XPath

matches:[
...
  {"match":"dolor", "xpath":"//*[@id="lipsum"]/p[1]/b"}
...
]