Questions tagged [hibernate-search]

Hibernate Search automatically extracts data from Hibernate ORM entities to push it to local Apache Lucene indexes or remote Elasticsearch indexes.

hibernate-search
Filter by
Sorted by
Tagged with
1 vote
1 answer
5k views

Hibernate Search: How to use wildcards correctly?

I have the following query to search patients by full name, for an specific medical center: MustJunction mj = qb.bool().must(qb.keyword() .onField("medicalCenter.id") .matching(medicalCenter....
Mauricio Ubilla Carvajal's user avatar
2 votes
1 answer
2k views

Hibernate Search | ngram analyzer with minGramSize 1

I have some problems with my Hibernate Search analyzer configuration. One of my indexed entities ("Hospital") has a String field ("name") that could contain values with lengths from 1-40. I want to ...
André's user avatar
  • 514
10 votes
2 answers
25k views

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

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-...
Panayiotis Karabassis's user avatar
4 votes
1 answer
11k views

How to search between dates (Hibernate Search)?

I am wondering how I can search between by dates in Hibernate Search using Range-Query or is there any filter I have to implement.Following is my field in Record Entity /** * When the ...
Dangling Piyush's user avatar
28 votes
6 answers
15k views

Solr vs Hibernate Search - Which to choose and When?

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 ...
Lucky Murari's user avatar
  • 12.7k
7 votes
1 answer
3k views

Hibernate Search vs spring-data-solr , spring-data-elasticsearch

I have a spring boot, Spring Data JPA (hibernate) web application and want to introduce text search feature. I understand the following Both hibernate search or spring-data-* can be integrated ...
Mukun's user avatar
  • 1,796
6 votes
2 answers
489 views

How to do case insensitive sorting of Norwegian characters (Æ, Ø, and Å) using Hibernate Lucene Search?

æ, ø, å are latest letters in the norwegian alphabet A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Æ Ø Å When we try to sort it using Hibernate Lucene then Å clubs with A, Ø clubs with Ø, Æ ...
fatherazrael's user avatar
  • 5,741
5 votes
2 answers
6k views

Spring Boot, Hibernate Search properties

How to provide Hibernate Search parameters when using Spring Boot? ... spring.datasource.driverClassName=org.postgresql.Driver hibernate.search.jmx_enabled=true hibernate.search.default....
retromuz's user avatar
  • 809
4 votes
1 answer
5k views

How to integrate Hibernate and Solr together?

For people working with Hibernate to manage their objects persistence, Hibernate search is a real savior. After trying to develop similar functionality (collecting all objects changes and sending them ...
Avner Levy's user avatar
  • 6,701
1 vote
1 answer
661 views

How to do highlighting within HibernateSearch over Elasticsearch

Background: We're in the process of converting our java application from Lucene to Elasticsearch 5.6.6. Using Hibernate 5.2.11 and Hibernate-Search 5.8.2. We have a number of custom Analyzers which ...
Rick Gagne's user avatar
1 vote
3 answers
1k views

hibernate search without database

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 ...
Kevin's user avatar
  • 25.1k
1 vote
1 answer
1k views

Hibernate Search: configure Facet for custom FieldBridge

In this example DateSplitBridge.java dynamic fields are added to indexed document: public class DateSplitBridge implements FieldBridge { ... public void set(String name, Object value, Document ...
aillusions's user avatar
0 votes
1 answer
428 views

Hibernate Search Order by child-count

Consider: @Indexed @Entity public class TParent implements java.io.Serializable { ..... private Set<TChild> TChildSet = new HashSet<TChild>(0); @ContainedIn @OneToMany(cascade=...
John's user avatar
  • 189
27 votes
5 answers
8k views

SaaS / Multi-Tenancy approaches for Java-based (GWT, Spring, Hibernate) web applications

I am currently looking into converting a single-tenant Java based web-app that uses Spring, GWT, Hibernate, Jackrabbit, Hibernate Search / Lucene (among others) into a fully fledged SaaS style app. I ...
brent777's user avatar
  • 3,379
19 votes
1 answer
9k views

How to replace deprecated MultipleHiLoPerTableGenerator with TableGenerator in Hibernate

I use hibernate in an application with spring boot 1.4.0.RELEASE. The Entity for the index looks something along the lines of: @Entity(name = "SearchableTariffItem") @Indexed public class ...
leo's user avatar
  • 3,729
13 votes
1 answer
1k views

How to disable default scoring/boosting in Hibernate Search/Lucene?

I want to serve my users the most relevant and best results. For example, I'm rewarding records that have a big title, description, attached photos, etc. For context: the records are bicycle routes, ...
Thermometer's user avatar
  • 2,637
10 votes
1 answer
16k views

How to implement full text search in Spring Boot with JPA + MySQL

public class Product { private Long id; private String name; private String description; } Is there any way to implement a full text search with JpaRepository for the description ...
Konstantinos Kyriakos's user avatar
9 votes
3 answers
4k views

Getting error on a specific query

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 ...
ftkg's user avatar
  • 1,702
8 votes
1 answer
5k views

Hibernate Search sorting

Hibernate search is sorting results depending on relevance, it is normal. In addition to that, if two documents are having the same score, they are ordered by their primary keys. For example, book1 ...
Bilal BBB's user avatar
  • 1,154
8 votes
4 answers
10k views

How do I use boolean operators with Hibernate Search

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 ...
NobodyMan's user avatar
  • 2,411
7 votes
2 answers
11k views

How to search fields with wildcard and spaces in Hibernate Search

I have a search box that performs a search on title field based on the given input, so the user has recommended all available titles starting with the text inserted.It is based on Lucene and Hibernate ...
zoran jeremic's user avatar
7 votes
1 answer
3k views

Hibernate Search in a Clustered Configuration?

I have a Java web app that I'm developing, using JBoss Seam as the application framework. I'd like to take advantage of Hibernate Search to provide entity searching capabilities. The integration has ...
Shadowman's user avatar
  • 11.7k
6 votes
2 answers
8k views

get the annotation information at runtime

I wonder if there is any way I can get the annotation information of a class at runtime? Since I want to get the properties that sepcifily annotated. Example: class TestMain { @Field( ...
hguser's user avatar
  • 35.6k
6 votes
1 answer
3k views

Is @DocumentId required for Hibernate Search?

I'm using Hibernate Search and the documentation and books say I need @DocumentId on the id field so that Hibernate Search can know how to map the index to the objects. My code appears to be working ...
jackcrews's user avatar
  • 125
6 votes
1 answer
2k views

How to remove all the duplicate results in Hibernate Search?

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 ...
Stephan's user avatar
  • 207
5 votes
3 answers
3k views

index not updating after external entity changes

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, ...
Kyne H's user avatar
  • 133
5 votes
2 answers
5k views

Lucene / Hibernate Search Lock Exception

I use Hibernate Search to index and full-text search items on a web application, problem-less! From my pom.xml: <hibernate.search.version>3.4.2.Final</hibernate.search.version> <...
Wizche's user avatar
  • 891
5 votes
1 answer
4k views

Hibernate Search 5.0 Numeric Lucene Query HSEARCH000233 issue

Issue: how do we provide hibernate search with a raw lucene query string that includes numeric and non-numeric fields? Background: we recently upgraded to HibernateSearch 5.0 and many of our queries ...
adam's user avatar
  • 1,077
5 votes
1 answer
2k views

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

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. ...
Atul Kumar's user avatar
4 votes
1 answer
778 views

ClassCastException with Lucene

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 ...
Rallenaldo's user avatar
4 votes
3 answers
4k views

hibernate search + spring3 + jpa

I'm trying to integrate hibernate search in my project. My models are indexed, but for some reason my search queries do not return any results. I've been trying to solve this issue for a few hours now,...
Jeroen's user avatar
  • 527
4 votes
1 answer
324 views

Use existing analyzer in hibernate search AnalyzerDiscriminator

@Entity @Indexed @AnalyzerDefs({ @AnalyzerDef(name = "en", tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class), filters = { @TokenFilterDef(factory = ...
user avatar
4 votes
3 answers
5k views

Can you sort and search on same field with Hibernate/Lucene?

I have the following annotated class that I am trying to sort the results from a lucene/hibernate search query. I finally have the query working properly but it seems that when I implement the ...
Adam James's user avatar
  • 4,071
4 votes
1 answer
15k views

java.lang.NoClassDefFoundError: org/hibernate/service/ServiceRegistry

I am using hibernate-search 5.5.4.Final with hibernate-entitymanager 5.0.9 (matched with hibernate-core 5.0.9). But when i deployed the ejb maven module on glassfish 4.1. I obtained the following ...
Sergio Sánchez Sánchez's user avatar
3 votes
2 answers
4k views

Spring MVC code- Throws HSEARCH000103 exception when it is being deployed

In our springmvc website, we are using hibernate search with lucene. There are no issues when i compile the code, but when i try to deploy the code on a tomcat 7.0.52 running on Ubuntu 14.04 64bit ...
jsooner's user avatar
  • 31
3 votes
1 answer
1k views

Hibernate full text search custom order by

We want to add custom order by to hibernate full text search,suppose we want to search the record based on location, if the location is "country,state,city Then we want to have the search with ...
Mohsin's user avatar
  • 469
3 votes
2 answers
1k views

Teracotta and Hibernate Search

Does anyone have experience with using Terracotta with Hibernate Search to satisfy application Queries? If so: What magnitude of "object updates" can it handle? (How's the performance) What kind ...
mainstringargs's user avatar
3 votes
2 answers
3k views

How to search in related entity (Hibernate search)

I am getting no where trying this thing .My requirement is to search records by their name Following are my related classes: RecordFolderAnalysis.java @Indexed public class RecordFolderAnalysis ...
Dangling Piyush's user avatar
3 votes
4 answers
4k views

How to not transform special characters to html entities with owasp antisamy

I use Owasp Anti samy with Ebay policy file to prevent XSS attacks on my website. I also use Hibernate search to index my objects. When I use this code: String html = "special word: été"; // ...
Jerome Cance's user avatar
  • 8,143
3 votes
3 answers
9k views

Join hibernate search query with criteria query restriction

I'm wondering how you would join the following two queries together. A standard criteria query Criteria result1 = session.createCriteria(Store.class).add(Restrictions.eq("department.name", category)...
Code Junkie's user avatar
  • 7,692
3 votes
1 answer
3k views

Unable to query Infinispan on JBoss 7 due to SearchFactoryIntegrator not being in the registry

TL:DR I'm getting the following error and I can see no reason for it, indexing is enabled, and the SearchFactoryIntegrator is on the classpath for everything that needs to see it. Indexing was not ...
Kevin D's user avatar
  • 3,564
3 votes
1 answer
1k views

nHibernate.Search with nHibernate v2

I having trouble getting nHibernate.Search to create an Index. If I use 1.2.1.4 of nHibernate.dll & nHibernate.Search.dll then the index is created correctly and I can inspect it with Luke (a ...
ChrisCa's user avatar
  • 10.9k
3 votes
1 answer
802 views

What is the Best method to access hiberante search (lucene) files on amazon s3

I am using amazon s3 to host my website (so far - very impressed), however, I want to host my hibernate search index files and subdirectories in a manner that will scale. Could I use the Amazon s3 ...
jaseFace's user avatar
  • 1,445
3 votes
1 answer
3k views

Lucene Analyzer for Indexing and Searching

I have a field that I am indexing with Lucene like so: @Field(name="hungerState", index=Index.TOKENIZED, store=Store.YES) public HungerState getHungerState() { The possible values of this field are ...
schmimd04's user avatar
  • 1,444
3 votes
1 answer
1k views

How to handle Hibernate-Search index recovery?

When an application server exits unexpectedly, Hibernate Search can not do a graceful shutdown of Lucene. Leaving write.lock files behind in each index directory. That is of course quite normal. But - ...
Jan Goyvaerts's user avatar
2 votes
1 answer
1k views

How to index a inherited field in Hibernate-search?

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 ...
alexcornejo's user avatar
2 votes
2 answers
3k views

Hibernate search to find partial matches of a phrase

In my project we are using hibernate search 4.5 with lucene-analyzers and solar. I provide a text field to my clients. When they type in a phrase I would like to find all User entities whose names ...
PS Kumar's user avatar
  • 2,266
2 votes
1 answer
1k views

Hibernate HQL query does not update the Lucene Index

I am using Hibernate 3.6.3 Final and Hibernate Search 3.4.1. I wrote an HQL delete query. The objects are deleted from the database but they are not removed from the Lucene Index after the transaction ...
fastfurious's user avatar
2 votes
1 answer
2k views

Generate @Indexed annotation using Jaxb or HyperJaxb

I want to implement lucene based hibernate search in my assignment. For generating domain objects I am using HyperJaxb3. I want @Indexed annotation to be added during domain object creation using ...
suhas khot's user avatar
2 votes
3 answers
2k views

Lucene wildcard matching fails on chemical notations(?)

Using Hibernate Search Annotations (mostly just @Field(index = Index.TOKENIZED)) I've indexed a number of fields related to a persisted class of mine called Compound. I've setup text search over all ...
Tim's user avatar
  • 20.2k