hibernate-search

Getting error on a specific query

时光毁灭记忆、已成空白 提交于 2019-12-21 09:33:50
问题 Novice on Lucene here. I'm using it with Hibernate in a java client, and have been getting this error on a particular query: HSEARCH000146: The query string 'a' applied on field 'name' has no meaningfull tokens to be matched. Validate the query input against the Analyzer applied on this field. Search works fine for all other queries, even with empty resultset. My testing DB does have this record with 'a'. What could be wrong here? 回答1: 'a' is a stopword, and will be filtered out of your query

index not updating after external entity changes

馋奶兔 提交于 2019-12-21 05:28:14
问题 I'm currently working on a project to persist data with JPA 2.1 and to search entities using hibernate search 4.5.0.final. After mapping classes and indexing, the searching works fine. However, when I changed the value description of classB from "someStr" to "anotherStr". The database was updated accordingly, but when I checked the index using Luke, classA.classB.description in the index wasn't updated, and the data cannot be searchable by keyword "anotherStr", but can be searchable by

lucene index not getting sync when any update occurs in DB through hibernate

爷,独闯天下 提交于 2019-12-21 02:14:10
问题 I am working on some POC stuff on Hibernate Search based on Lucene using below env: hibernate-search-engine-4.4.2.Final.jar lucene-core-3.6.2.jar MySQL 5.5 Use @Indexed annotation on domain class. Use @Field(index=Index.YES, analyze=Analyze.YES, store=Store.NO) over field. Use @IndexedEmbedded over collection of Instance of different domain class. I did explicit indexing ONLY on start of application (as this is written in Hibernate Search API that Hibernate Search will transparently index

How do I use boolean operators with Hibernate Search

拜拜、爱过 提交于 2019-12-21 01:08:50
问题 I'm learning the Hibernate Search Query DSL, and I'm not sure how to construct queries using boolean arguments such as AND or OR. For example, let's say that I want to return all person records that have a firstName value of "bill" or "bob". Following the hibernate docs, one example uses the bool() method w/ two subqueries, such as: QueryBuilder b = fts.getSearchFactory().buildQueryBuilder().forEntity(Person.class).get(); Query luceneQuery = b.bool() .should(b.keyword().onField("firstName")

hibernate search without database

喜欢而已 提交于 2019-12-20 04:20:03
问题 Is it possible to use hibernate-search only for it's annotations (bean => document/document => bean mapping), without using a database at all? If so, are there any online samples that show basically how to set this up? I found the following: http://mojodna.net/2006/10/02/searchable-annotation-driven-indexing-and-searching-with-lucene.html, but I'd prefer hibernate-search if it supports my use case. 回答1: I don't think that's possible because when you enable Hibernate search you are enabling

Solr vs Hibernate Search - Which to choose and When?

不想你离开。 提交于 2019-12-18 10:37:12
问题 We are building an ecommerce application. We are using JAVA stack with Hibernate and Spring Framework. As with all ecommerce application, we need to build search capability into ours. So, we came across Hibernate Search and Apache Solr . Can someone list out the pros and cons of both of them so that we can select the ideal solution for Enterprise Search? 回答1: Apache Solr is mainly used for full text search: if you want to find words (singular and plurals for example) in a big set of documents

java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z

橙三吉。 提交于 2019-12-17 16:44:37
问题 I am getting this error: java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z These are the jars in my classpath: com.sun.faces/jsf-api/jars/jsf-api-2.0.0.jar com.sun.faces/jsf-impl/jars/jsf-impl-2.0.0.jar org.apache.myfaces.orchestra/myfaces-orchestra-core20/jars/myfaces-orchestra-core20-1.5-SNAPSHOT.jar commons-lang/commons-lang/jars/commons-lang-2.1.jar commons-logging/commons-logging/jars/commons-logging-1.1.1.jar org.springframework/spring/jars/spring-2.5.6.jar

ClassCastException with Lucene

时光毁灭记忆、已成空白 提交于 2019-12-14 04:17:49
问题 I´m working on a web application with Hibernate Search using Lucene. I updatetd this application to Hibernate 5.5.1 (former 4.3.5 (hibernate-core ) 4.3.10 (hibernate-entity-manager). I´ve created an lucene index (version 4.7) with the former application. And I think the problem is maybe the older index version. When I try to deploy my application I get the following stacktrace: Schwerwiegend: java.lang.ExceptionInInitializerError at org.apache.lucene.codecs.PostingsFormat.forName

Exception in thread “main” java.lang.IllegalArgumentException: java.lang.Object is not an indexed entity or a subclass of an indexed entity

纵然是瞬间 提交于 2019-12-14 03:13:28
问题 Am trying to configure HibernateSearch for ElasticSearch Integration. I have Product table in my oracle database. From that table am trying to search based on product name. For that am trying to integrate HibernateSearch (ElasticSearch) along with oracle database. Am getting the below error from HibernateSearch : Am using Oracle database and added the required dependencies in my pom.xml file Exception in thread "main" java.lang.IllegalArgumentException: java.lang.Object is not an indexed

How to annotate to allow for searching a List<String> field using Hibernate Search

依然范特西╮ 提交于 2019-12-14 01:56:45
问题 Let's say I have a domain object that looks like this: @Entity @Indexed public class Thingie implements DomainObject { private Long id; private Integer version; private String title; private List<String> keywords = new Vector<String>(); @Id @GeneratedValue public Long getId() { return id; } public void setId(Long id) { this.id = id; } @Version public Integer getVersion() { return version; } public void setVersion(Integer version) { this.version = version; } @Column(length=64, nullable=false)