<tfoot id='oGuYx'></tfoot>

    • <bdo id='oGuYx'></bdo><ul id='oGuYx'></ul>
  1. <legend id='oGuYx'><style id='oGuYx'><dir id='oGuYx'><q id='oGuYx'></q></dir></style></legend>
  2. <small id='oGuYx'></small><noframes id='oGuYx'>

      <i id='oGuYx'><tr id='oGuYx'><dt id='oGuYx'><q id='oGuYx'><span id='oGuYx'><b id='oGuYx'><form id='oGuYx'><ins id='oGuYx'></ins><ul id='oGuYx'></ul><sub id='oGuYx'></sub></form><legend id='oGuYx'></legend><bdo id='oGuYx'><pre id='oGuYx'><center id='oGuYx'></center></pre></bdo></b><th id='oGuYx'></th></span></q></dt></tr></i><div id='oGuYx'><tfoot id='oGuYx'></tfoot><dl id='oGuYx'><fieldset id='oGuYx'></fieldset></dl></div>

      显示来自 Lucene 搜索结果的示例文本

      时间:2023-09-29

        <small id='59zFk'></small><noframes id='59zFk'>

        <legend id='59zFk'><style id='59zFk'><dir id='59zFk'><q id='59zFk'></q></dir></style></legend>

          <tbody id='59zFk'></tbody>

            <bdo id='59zFk'></bdo><ul id='59zFk'></ul>
            <tfoot id='59zFk'></tfoot>

              1. <i id='59zFk'><tr id='59zFk'><dt id='59zFk'><q id='59zFk'><span id='59zFk'><b id='59zFk'><form id='59zFk'><ins id='59zFk'></ins><ul id='59zFk'></ul><sub id='59zFk'></sub></form><legend id='59zFk'></legend><bdo id='59zFk'><pre id='59zFk'><center id='59zFk'></center></pre></bdo></b><th id='59zFk'></th></span></q></dt></tr></i><div id='59zFk'><tfoot id='59zFk'></tfoot><dl id='59zFk'><fieldset id='59zFk'></fieldset></dl></div>
                本文介绍了显示来自 Lucene 搜索结果的示例文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                目前,我正在使用 Lucene 版本 3.0.2 创建一个类似于字典的搜索应用程序.我要显示的对象之一是一种示例",Lucene 会在其中查找书中的一个单词,然后显示使用这些单词的句子.

                Currently, I am using Lucene version 3.0.2 to create a search application that is similar to a dictionary. One of the objects that I want to display is a sort of "example", where Lucene would look for a word in a book and then the sentences where the words were used are displayed.

                我一直在阅读 Lucene in Action 这本书,其中提到了类似的内容,但通过它我找不到其他提及.这是你可以用 Lucene 做的事情吗?如果是,你是怎么做到的?

                I've been reading the Lucene in Action book and it mentions something like this, but looking through it I can't find other mentions. Is this something you can do with Lucene? If it is, how is can you do it?

                推荐答案

                我相信您正在寻找的是荧光笔.

                I believe what you are looking for is a Highlighter.

                一种可能性是使用 lucene.search.highlight 包,特别是 荧光笔.

                One possibility is to use the lucene.search.highlight package, specifically the Highlighter.

                另一种选择是使用 lucene.search.vectorhighlight 包,特别是 FastVectorHighlighter.

                Another option is to use the lucene.search.vectorhighlight package, specifically the FastVectorHighlighter.

                这两个类都搜索文本文档,选择相关的片段并显示它们,并突出显示匹配的术语.我只使用了第一个,它适用于我的用例.如果您可以将图书预先分成较短的部分,那么突出显示的速度会更快.

                Both classes search a text document, choose relevant snippets and display them with the matching terms highlighted. I have only used the first one, which worked fine for my use-case. If you can pre-divide the book into shorter parts, it would make highlighting faster.

                这篇关于显示来自 Lucene 搜索结果的示例文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:没有数据库的休眠搜索 下一篇:弹性搜索中的模式匹配?

                相关文章

                最新文章

                <tfoot id='QqxCI'></tfoot>

                <small id='QqxCI'></small><noframes id='QqxCI'>

                  <bdo id='QqxCI'></bdo><ul id='QqxCI'></ul>
                <i id='QqxCI'><tr id='QqxCI'><dt id='QqxCI'><q id='QqxCI'><span id='QqxCI'><b id='QqxCI'><form id='QqxCI'><ins id='QqxCI'></ins><ul id='QqxCI'></ul><sub id='QqxCI'></sub></form><legend id='QqxCI'></legend><bdo id='QqxCI'><pre id='QqxCI'><center id='QqxCI'></center></pre></bdo></b><th id='QqxCI'></th></span></q></dt></tr></i><div id='QqxCI'><tfoot id='QqxCI'></tfoot><dl id='QqxCI'><fieldset id='QqxCI'></fieldset></dl></div>

                  1. <legend id='QqxCI'><style id='QqxCI'><dir id='QqxCI'><q id='QqxCI'></q></dir></style></legend>