hibernate-search

How to remove all the duplicate results in Hibernate Search?

 ̄綄美尐妖づ 提交于 2021-02-20 09:31:13
问题 I'm using Infinispan with 6.0.2 with Hibernate Search 4.4.0. In the begining, after I execute a query like CacheQuery cq = SearchManager.getQuery(query,Hibernate.class).projection("id"); I use the cq.list() to get "id". But now the number of results reaches 300.000, because of the designing fo DB(cant change), the duplicate id is almost 29,000. I wrote this to get "id": for(int i=0;i<listObject.size();i++) { Object[] rdf = (Object[])listObject.get(i); if(!result.contains((String) rdf[0]))

How to remove all the duplicate results in Hibernate Search?

醉酒当歌 提交于 2021-02-20 09:27:45
问题 I'm using Infinispan with 6.0.2 with Hibernate Search 4.4.0. In the begining, after I execute a query like CacheQuery cq = SearchManager.getQuery(query,Hibernate.class).projection("id"); I use the cq.list() to get "id". But now the number of results reaches 300.000, because of the designing fo DB(cant change), the duplicate id is almost 29,000. I wrote this to get "id": for(int i=0;i<listObject.size();i++) { Object[] rdf = (Object[])listObject.get(i); if(!result.contains((String) rdf[0]))

How to index composite primary keys in hibernate search

北城以北 提交于 2021-02-11 12:32:27
问题 I have the following class definitions and for class UserAdAccount, it uses both the adAccountId and userId as its composite primary key. I need to use this composite primary key as the document id for indexing. After reading the Hibernate Search 5.11.5.Final: Reference Guide(This is the version I am using), I found the following: The more powerful TwoWayFieldBridge interface allows you to store more than one field into the index, which can be useful for composite properties, but is more

How to index a inherited field in Hibernate-search?

烈酒焚心 提交于 2021-01-29 09:35:51
问题 I am working in a java jpa Hibernate-search application, I know Hibernate-search index automatically every @Id annotation in an entity. The problem is that I have a "master domain" class with contains the @Id annotation, and then I have another class with inherit "master domain", then seems to be the Hibernate search is not recognizing the @Id field inherited. this is my master domain class. @MappedSuperclass @Inheritance(strategy = InheritanceType.JOINED) public abstract class MasterDomain

Multiword synonyms with Solr and Hibernate Search

女生的网名这么多〃 提交于 2021-01-28 08:05:47
问题 I have a synonyms.txt file with content as below car accessories, gadi marmat and I am indexing car accessories as a single token so that it will expand to car accessories and gadi marmat . i want the whole synonyms to match so that when query for gadi marmat , the record with car accessories to be returned. I am using shingle filter factory to expand query so that when searching for gadi marmat , it will be expanded to gadi , gadi marmat and marmat , and since gadi marmat is queried as a

How to fix "NoSuchMethodError ParameterMetadataImpl <init>

試著忘記壹切 提交于 2021-01-05 09:11:37
问题 When I run the searchByKeywords method show in the code, I receive an error message about a missing constructor for org.hibernate.query.internal.ParameterMetadataImpl: java.lang.NoSuchMethodError: org.hibernate.query.internal.ParameterMetadataImpl.<init>([Lorg/hibernate/engine/query/spi/OrdinalParameterDescriptor;Ljava/util/Map;)V at org.hibernate.search.impl.FullTextSessionImpl.createFullTextQuery(FullTextSessionImpl.java:88) ~[hibernate-search-orm-5.9.2.Final.jar:5.9.2.Final] at org

How to fix "NoSuchMethodError ParameterMetadataImpl <init>

十年热恋 提交于 2021-01-05 09:10:56
问题 When I run the searchByKeywords method show in the code, I receive an error message about a missing constructor for org.hibernate.query.internal.ParameterMetadataImpl: java.lang.NoSuchMethodError: org.hibernate.query.internal.ParameterMetadataImpl.<init>([Lorg/hibernate/engine/query/spi/OrdinalParameterDescriptor;Ljava/util/Map;)V at org.hibernate.search.impl.FullTextSessionImpl.createFullTextQuery(FullTextSessionImpl.java:88) ~[hibernate-search-orm-5.9.2.Final.jar:5.9.2.Final] at org

How to fix "NoSuchMethodError ParameterMetadataImpl <init>

試著忘記壹切 提交于 2021-01-05 09:10:39
问题 When I run the searchByKeywords method show in the code, I receive an error message about a missing constructor for org.hibernate.query.internal.ParameterMetadataImpl: java.lang.NoSuchMethodError: org.hibernate.query.internal.ParameterMetadataImpl.<init>([Lorg/hibernate/engine/query/spi/OrdinalParameterDescriptor;Ljava/util/Map;)V at org.hibernate.search.impl.FullTextSessionImpl.createFullTextQuery(FullTextSessionImpl.java:88) ~[hibernate-search-orm-5.9.2.Final.jar:5.9.2.Final] at org

Hibernate search sorting with collation

对着背影说爱祢 提交于 2020-04-18 12:34:16
问题 I upgraded Hibernate search from version - 4.3.0.Final to the latest stable version - 5.4.12.Final. All is good except sorting norwegian words. In the old version of hibernate there was SortField with locale in the constructor: /** Creates a sort, possibly in reverse, by terms in the given field sorted * according to the given locale. * @param field Name of field to sort by, cannot be <code>null</code>. * @param locale Locale of values in the field. */ public SortField (String field, Locale