ERROR org.hibernate.search.exception.impl.LogErrorHandler - HSEARCH000058: HSEARCH000183: Unable to index instance of type

2019-06-12 10:17:42 [Hibernate Search: entityloader-1] ERROR org.hibernate.search.exception.impl.LogErrorHandler - HSEARCH000058: HSEARCH000183: Unable to index instance of type net.shopxx.entity.Product while batch indexing: Entity of type net.shopxx.entity.Product with id: 11374
java.lang.IllegalArgumentException: position increments (and gaps) must be >= 0 (got 581043) for field ‘introduction‘
    at org.apache.lucene.index.DefaultIndexingChain$PerField.invert(DefaultIndexingChain.java:649)
    at org.apache.lucene.index.DefaultIndexingChain.processField(DefaultIndexingChain.java:365)
    at org.apache.lucene.index.DefaultIndexingChain.processDocument(DefaultIndexingChain.java:321)
    at org.apache.lucene.index.DocumentsWriterPerThread.updateDocument(DocumentsWriterPerThread.java:234)
    at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:450)
    at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:1477)
    at org.hibernate.search.backend.impl.lucene.IndexWriterDelegate.updateDocument(IndexWriterDelegate.java:66)
    at org.hibernate.search.backend.impl.lucene.IndexWriterDelegate.addDocument(IndexWriterDelegate.java:55)
    at org.hibernate.search.backend.impl.lucene.works.AddWorkExecutor.performWork(AddWorkExecutor.java:54)
    at org.hibernate.search.backend.impl.lucene.LuceneBackendTaskStreamer.doWork(LuceneBackendTaskStreamer.java:52)
    at org.hibernate.search.backend.impl.lucene.WorkspaceHolder.applyStreamWork(WorkspaceHolder.java:74)
    at org.hibernate.search.indexes.spi.DirectoryBasedIndexManager.performStreamOperation(DirectoryBasedIndexManager.java:103)
    at org.hibernate.search.backend.impl.StreamingOperationExecutorSelector$AddSelectionExecutor.performStreamOperation(StreamingOperationExecutorSelector.java:106)
    at org.hibernate.search.backend.impl.batch.DefaultBatchBackend.sendWorkToShards(DefaultBatchBackend.java:73)
    at org.hibernate.search.backend.impl.batch.DefaultBatchBackend.enqueueAsyncWork(DefaultBatchBackend.java:49)
    at org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.index(IdentifierConsumerDocumentProducer.java:297)
    at org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.indexAllQueue(IdentifierConsumerDocumentProducer.java:223)
    at org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.loadList(IdentifierConsumerDocumentProducer.java:177)
    at org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.loadAllFromQueue(IdentifierConsumerDocumentProducer.java:140)
    at org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.run(IdentifierConsumerDocumentProducer.java:117)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:748)
2019-06-12 10:17:42 [Hibernate Search: entityloader-4] WARN  org.hibernate.search.backend.impl.lucene.IndexWriterHolder - HSEARCH000052: Going to force release of the IndexWriter lock
2019-06-12 10:17:42 [Hibernate Search: entityloader-1] WARN  org.hibernate.search.backend.impl.lucene.IndexWriterHolder - HSEARCH000052: Going to force release of the IndexWriter lock
2019-06-12 10:17:42 [Hibernate Search: entityloader-6] WARN  org.hibernate.search.backend.impl.lucene.IndexWriterHolder - HSEARCH000052: Going to force release of the IndexWriter lock
2019-06-12 10:17:42 [Hibernate Search: entityloader-4] ERROR org.hibernate.search.exception.impl.LogErrorHandler - HSEARCH000058: HSEARCH000183: Unable to index instance of type net.shopxx.entity.Product while batch indexing: Entity of type net.shopxx.entity.Product with id: 12467
java.lang.IllegalArgumentException: position increments (and gaps) must be >= 0 (got 600772) for field ‘introduction‘
    at org.apache.lucene.index.DefaultIndexingChain$PerField.invert(DefaultIndexingChain.java:649)
    at org.apache.lucene.index.DefaultIndexingChain.processField(DefaultIndexingChain.java:365)
    at org.apache.lucene.index.DefaultIndexingChain.processDocument(DefaultIndexingChain.java:321)
    at org.apache.lucene.index.DocumentsWriterPerThread.updateDocument(DocumentsWriterPerThread.java:234)
    at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:450)
    at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:1477)
    at org.hibernate.search.backend.impl.lucene.IndexWriterDelegate.updateDocument(IndexWriterDelegate.java:66)
    at org.hibernate.search.backend.impl.lucene.IndexWriterDelegate.addDocument(IndexWriterDelegate.java:55)
    at org.hibernate.search.backend.impl.lucene.works.AddWorkExecutor.performWork(AddWorkExecutor.java:54)
    at org.hibernate.search.backend.impl.lucene.LuceneBackendTaskStreamer.doWork(LuceneBackendTaskStreamer.java:52)
    at org.hibernate.search.backend.impl.lucene.WorkspaceHolder.applyStreamWork(WorkspaceHolder.java:74)
    at org.hibernate.search.indexes.spi.DirectoryBasedIndexManager.performStreamOperation(DirectoryBasedIndexManager.java:103)
    at org.hibernate.search.backend.impl.StreamingOperationExecutorSelector$AddSelectionExecutor.performStreamOperation(StreamingOperationExecutorSelector.java:106)
    at org.hibernate.search.backend.impl.batch.DefaultBatchBackend.sendWorkToShards(DefaultBatchBackend.java:73)
    at org.hibernate.search.backend.impl.batch.DefaultBatchBackend.enqueueAsyncWork(DefaultBatchBackend.java:49)
    at org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.index(IdentifierConsumerDocumentProducer.java:297)
    at org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.indexAllQueue(IdentifierConsumerDocumentProducer.java:223)
    at org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.loadList(IdentifierConsumerDocumentProducer.java:177)
    at org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.loadAllFromQueue(IdentifierConsumerDocumentProducer.java:140)
    at org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.run(IdentifierConsumerDocumentProducer.java:117)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:748)

在使用hibernate分析器的时候,如果分析器作用的字段过长的时候,就会出现以上的报错

解决方法:

    /**
     * 介绍
     */
    @Field(store = Store.YES, index = Index.YES, analyze = Analyze.NO)
    @Lob
    @Basic(fetch = FetchType.LAZY)
    private String introduction;

analyze = Analyze.NO这句是关键,将YES改成NO

原文地址:https://www.cnblogs.com/longsanshi/p/11008036.html

时间: 2024-10-10 20:38:11

ERROR org.hibernate.search.exception.impl.LogErrorHandler - HSEARCH000058: HSEARCH000183: Unable to index instance of type的相关文章

[Hibernate Search] (4) 实体类型的高级映射功能

高级映射 前面介绍的可搜索的域基本上都是字符串类型,实际上可搜索的类型是非常丰富的. 本文会介绍以下几个方面的内容: Lucene对实体进行索引的过程 借助Solr组件对这个过程的改进 修改域的重要程度,从而让基于相关度的排序更加有意义 动态决定是否对一个实体类型进行索引 桥接器(Bridges) 实体类型中可以使用的类型是无穷无尽的,但是对于Lucene索引而言,任何类型归根到底都会以字符串来表示.所以,在对实体的域进行索引时,这些域最终需要被转换为字符串类型的对象. 在Hibernate S

将Hibernate Search集成进已有项目中,实现全文检索功能

本来是准备使用Lucene的但是新版本的API过于繁琐,最后还是决定使用Hibernate Search来实现全文检索.这篇博文以我以前做的博客为例来实现全文检索. 1.修改Hibernate配置文件,因为我的系统采用的是SSH2来开发的所以我修改的是spring配置文件 <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">

ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] - Data truncation: Incorrect datetime value: &#39;&#39; for column &#39;pubdate&#39; at row 1

之前的Connector/J版本是:mysql-connector-java-5.0.4-bin.jar 后来换成mysql-connector-java-5.1.45-bin.jar,问题解决 2018-02-16 01:07:10,086 WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] - SQL Error: 0, SQLState: 220012018-02-16 01:07:10,086 ERROR [org.hibern

S2SH+Hibernate search出现的问题

一  java.lang.NoSuchMethodError: org.hibernate.engine.transaction.spi.TransactionEnvironment.getJtaPlatform()Lorg/hibernate/service/jta/platform/spi/JtaPlatform 相信大家遇到这个问题一定是累觉不爱了吧,呵呵.本人qq1413557667 出现这个问题的原因是不同版本的(例如4.2跟4.5)的hibernate-core jar包里面In H

[Hibernate Search] (5) 高级查询 - 过滤,投影和分面

高级查询 在介绍了更多的高级映射功能之后,是时候回顾一下之前介绍过的查询功能了,看看如何借助这些高级的映射功能来使用一些高级的查询功能.本文会通过以下几个方面进行介绍: 如何在不和数据库进行任何交互的前提下,借助Lucene的力量来动态的筛选结果 如何通过使用基于投影(Projection)的查询来获取需要的属性,从而避免与数据库的交互 如何使用分面搜索(Faceted Search)对搜索结果进行划分 如何使用查询时提升(Boosting) 如何给查询设置时间限制 过滤(Filtering)

[Hibernate Search] (5) 解析和条件索引

解析(Analysis) 当一个实体域被Lucene索引时,往往还会经历一个语法分析(Parsing)和转换(Conversion)的步骤,这些步骤被称为解析.在前文中,我们提到过Hibernate Search会默认对字符串类型的实体域进行分词,而这个分词过程就需要用到解析器(Analyzer).在需要对实体域进行排序的场合,需要禁用这个默认的分词行为. 在解析过程中,还可以借助Apache Solr提供的组件来完成更多的操作.为了弄清楚Solr组件是如何参与到这个过程中并完成更多的操作,需要

struts2启动报错:ERROR com.opensymphony.xwork2.conversion.impl.DefaultConversionPropertiesProcessor - Conversion registration error

[framework] 2019-12-05 11:34:05,441 - org.springframework.web.context.ContextLoader -5352 [RMI TCP Connection(3)-127.0.0.1]INFO org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 5349 ms timer appl

Hibernate search与Lucene包异常学习心得

最近使用了了一下Hibernate  Search这个组件 这个组件是对域模型进行全文检索,在全文检索的底层实现上使用了Lucene技术 在进行小测试的时候费了很大的力气去搞定包的问题 我直接通过实例进行验证 开始的时候我用的是最新的hibernate—search包,导致的直接问题是各种包不一致 这个问题花了我很长时间,最突出的一个异常就是java.lang.VerifyError 在比较久远的hibernate-search.jar包如:hibernate-search-3.1.0.GA 中

[Hibernate Search] 实体类型的映射

实体类型映射 在上一篇文章中,简要介绍了如何使用Hibernate Search来对一个实体进行全文搜索. 然而,在真实的应用中,实体与实体之间的关系也许更为复杂.为了对复杂实体进行搜索,就需要让底层的Lucene查询也能够理解这些关系. 下图反映了Database,Hibernate,Hibernate Search和Lucene之间的关系: 域映射选项(Field Mapping Options) 我们已经知道@Field注解用来让某个域可以被全文搜索到. 实际上,在添加该注解后,Hiber