热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

是否有快速,准确的Lucene荧光笔?-Isthereafast,accurateHighlighterforLucene?

Ivebeenusingthe(Java)HighlighterforLucene(intheSandboxpackage)forsometime.However,t

I've been using the (Java) Highlighter for Lucene (in the Sandbox package) for some time. However, this isn't really very accurate when it comes to matching the correct terms in search results - it works well for simple queries, for example searching for two separate words will highlight both code fragments in the results.

我已经使用(Java)Highlighter for Lucene(在Sandbox包中)一段时间了。但是,在匹配搜索结果中的正确术语时,这并不是非常准确 - 它适用于简单查询,例如,搜索两个单独的单词将突出显示结果中的两个代码片段。

However, it doesn't act well with more complicated queries. In the simplest case, phrase queries such as "Stack Overflow" will match all occurrences of Stack or Overflow in the highlighting, which gives the impression to the user that it isn't working very well.

但是,对于更复杂的查询,它不能很好地运行。在最简单的情况下,诸如“Stack Overflow”之类的短语查询将匹配突出显示中所有出现的Stack或Overflow,这给用户留下了不能很好地工作的印象。

I tried applying the fix here but that came with a lot of performance caveats, and at the end of the day was just plain unusable. The performance is especially an issue on wildcard queries. This is due to the way that the highlighting works; instead of just working on the querystring and the text it parses it as Lucene would and then looks for all the matches that Lucene has made; unfortunately this means that for certain wildcard queries it can be looking for matches to 2000+ clauses on large documents, and it's simply not fast enough.

我尝试在这里应用修复程序,但这带来了很多性能警告,并且在一天结束时只是普遍无法使用。性能尤其是通配符查询的问题。这是由于突出显示的工作方式;它不是仅仅处理查询字符串和文本,而是像Lucene那样解析它,然后查找Lucene所做的所有匹配;不幸的是,这意味着对于某些通配符查询,它可以在大型文档上查找与2000+子句的匹配,并且它的速度不够快。

Is there any faster implementation of an accurate highlighter?

有没有更快的实现准确的荧光笔?

3 个解决方案

#1


2  

There is a new faster highlighter (needs to be patched in but will be part of release 2.9)

有一个新的更快的荧光笔(需要修补但将成为2.9版的一部分)

https://issues.apache.org/jira/browse/LUCENE-1522

and a back-reference to this question

并且对这个问题的反向引用

#2


1  

You could look into using Solr. http://lucene.apache.org/solr

你可以考虑使用Solr。 http://lucene.apache.org/solr

Solr is a sort of generic search application that uses Lucene and supports highlighting. It's possible that the highlighting in Solr is usable as an API outside of Solr. You could also look at how Solr does it for inspiration.

Solr是一种使用Lucene并支持突出显示的通用搜索应用程序。 Solr中的突出显示可能可用作Solr之外的API。您还可以看看Solr如何为灵感做到这一点。

#3


1  

I've been reading on the subject and came across spanQuery which would return to you the span of the matched term or terms in the field that matched.

我一直在阅读这个主题,并遇到了spanQuery,它将返回匹配字段中匹配的术语或术语的范围。


推荐阅读
  • Lucene 全文检索技术入门
    一、搜索引擎的历史萌芽:Archie、Gopher起步:Robot(网络机器人)的出现与spider(网络爬虫)发展:excite、galax ... [详细]
  • 大数据Hadoop生态(20)MapReduce框架原理OutputFormat的开发笔记
    本文介绍了大数据Hadoop生态(20)MapReduce框架原理OutputFormat的开发笔记,包括outputFormat接口实现类、自定义outputFormat步骤和案例。案例中将包含nty的日志输出到nty.log文件,其他日志输出到other.log文件。同时提供了一些相关网址供参考。 ... [详细]
  • 本文介绍了解决java开源项目apache commons email简单使用报错的方法,包括使用正确的JAR包和正确的代码配置,以及相关参数的设置。详细介绍了如何使用apache commons email发送邮件。 ... [详细]
  • 请问:FixVersion字段这个字段怎么设置?比如我想添加一个自定义的字段,在创建时不见不能填写,到解决时才填写,而填写后浏览问题又可见,怎么设置?另:怎么修改jiraview界 ... [详细]
  • 用到lucene的爬虫的简单实现
    2019独角兽企业重金招聘Python工程师标准小菜鸟我最近研究了一下lucene,以及前面的爬虫的写法,我想到能否用lucene写一个站内搜索& ... [详细]
  • java之学习记录 92lecene 全文检索
    搭建springBoot项目依赖:<?xmlversion=1.0 ... [详细]
  • solr倒排索引(转载)
    原文地址:http:blog.csdn.netchichengitarticledetails9235157http:blog.csdn.netnjpjsoftdevarticle ... [详细]
  • 向QTextEdit拖放文件的方法及实现步骤
    本文介绍了在使用QTextEdit时如何实现拖放文件的功能,包括相关的方法和实现步骤。通过重写dragEnterEvent和dropEvent函数,并结合QMimeData和QUrl等类,可以轻松实现向QTextEdit拖放文件的功能。详细的代码实现和说明可以参考本文提供的示例代码。 ... [详细]
  • Linux重启网络命令实例及关机和重启示例教程
    本文介绍了Linux系统中重启网络命令的实例,以及使用不同方式关机和重启系统的示例教程。包括使用图形界面和控制台访问系统的方法,以及使用shutdown命令进行系统关机和重启的句法和用法。 ... [详细]
  • Spring学习(4):Spring管理对象之间的关联关系
    本文是关于Spring学习的第四篇文章,讲述了Spring框架中管理对象之间的关联关系。文章介绍了MessageService类和MessagePrinter类的实现,并解释了它们之间的关联关系。通过学习本文,读者可以了解Spring框架中对象之间的关联关系的概念和实现方式。 ... [详细]
  • CEPH LIO iSCSI Gateway及其使用参考文档
    本文介绍了CEPH LIO iSCSI Gateway以及使用该网关的参考文档,包括Ceph Block Device、CEPH ISCSI GATEWAY、USING AN ISCSI GATEWAY等。同时提供了多个参考链接,详细介绍了CEPH LIO iSCSI Gateway的配置和使用方法。 ... [详细]
  • HIVE 移动数据 (从表到分区表,分区表到子分区表)
    为什么80%的码农都做不了架构师?ExchangePartitionSkiptoendofmetadataCreatedbyNamitJain,lastmodi ... [详细]
  • 将单条消息的大小设置为大于服务端可以接受的消息大小,模拟发送异常的场景:消息大小1500message.max.bytes1000batch.size16384日志一直刷:[201 ... [详细]
  • 作为Spring的高强度使用者,没理由不对Spring的发展历程感到好奇吧?想知道Spring的作者,Spring是怎样一步一步的发展到今 ... [详细]
  • 升级到grails2.3.2之后,运行时报如下的异常:ExceptioninthreadmainError|ForkedGrailsVMexitedwitherrorjava. ... [详细]
author-avatar
Ray依依
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有