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 provides synchronization between entities managed by Hibernate ORM and full-text indexing services like Apache Lucene and Elasticsearch.

It will automatically apply changes to indexes, which is tedious and error prone coding work, while leaving you full control on the query aspects. The development community constantly researches and refines the index writing techniques to improve performance.

Mapping your objects to the indexes is declarative, using a combination of Hibernate Search specific annotations and the knowledge it can gather from your existing Hibernate/JPA mapping.

Queries can be defined by any combination of:

  • "native" Apache Lucene queries
  • writing "native" Elasticsearch queries in JSON format (if using Elasticsearch, which is optional)
  • using a DSL which abstracts the previous two generating optimal backend specific queries

Query results can include projections to be loaded directly from the index, or can materialize fully managed Hibernate entities loaded from the database within the current transactional scope.

Hibernate Search is using Apache Lucene under the cover; this can be used directly (running embedded in the same JVM) or remotely provided by an Elasticsearch server over its REST API.

Hibernate Search is open source and contributions are welcome both as patches or comments and suggestions.

For latest news follow the Hibernate team blog.

1466 questions
2
votes
3 answers

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 the indexed fields, using the…
Tim
  • 19,793
  • 8
  • 70
  • 95
2
votes
0 answers

Hibernate Search: Exception when trying to sort by long field with @SortableField

I updated Hibernate Search to 5.5 and I saw that I should use the annotation @SortableField on all fields that I want to be sortable. It works fine for String fields and also for a Double field. But when I try to sort a Long field, I'm getting this…
andrehil
  • 305
  • 2
  • 9
2
votes
2 answers

whats wrong with this simple HQL syntax?

Hi i am trying to execute this simple HQL query to get a list of files from my database using: private static final String SQL_GET_FILE_LIST = "select filename, size, id, type from fileobject"; @Override public List getFileList(String…
Jono
  • 17,341
  • 48
  • 135
  • 217
2
votes
3 answers

Hibernate Search with Spring MVC

I am trying to integrate Hibernate Search with existing Spring MVC application where I have used hibernate ORM to communicate with Database. When I add Hibernate Search dependencies in the pom.xml, it is throwing below error. …
Raghavendra
  • 3,876
  • 4
  • 22
  • 41
2
votes
1 answer

Tag Cloud with Hibernate Search/Lucene?

Our web application has a database of product categories, within which are n number of products. Each product can have 0 or more tags associated with it. All of these objects are indexed using Hibernate Search (JPA). We're trying to build a tag…
Shadowman
  • 11,150
  • 19
  • 100
  • 198
2
votes
1 answer

How to filter Hibernate Search results to include only that objects which are after object with special field value during sort?

I have curent method in my repository : List getSortedByDate(int limit, int lastId){ FullTextSession fullTextSession = fullTextSession(); QueryBuilder queryBuilder =…
Taras
  • 507
  • 1
  • 6
  • 17
2
votes
2 answers

Java program running in eclipse but not in command prompt

I've got a little project built by me, which is written in Java using Hibernate 5, Hibernate Search 5.5, Log4j2 and accesses PostgreSQL's 3 databases (2 of them validating their metadata and another one creating content). The issue is that it's a…
joninx
  • 1,775
  • 6
  • 31
  • 59
2
votes
1 answer

How to reindex lucene index in a cluster of servers using JMS topic in hibernate search 5.3

I am new to hibernate search and i am using hibernate search 5.3 for my application. I have a cluster of servers which should maintain a lucene index and if there's a change in entitty, I am trying to put it in a jms queue and let all the other…
2
votes
1 answer

Hibernate search : exact phrase matching

Using Hibernate Search, I cannot manage to search for an exact sentence. For instance, having the following sentences in my index : 1 - New York weather 2 - New York I want to get only the line 2 matching "New York", so I make the following query…
anthofo
  • 93
  • 12
2
votes
0 answers

Hibernate Search Integration with Apache Solr unable to index data

In my current application I use hibernate search to index and searching data. It works fine. But when building a cluster of server instances I do not need to use Master Slave clusters using JMS or JGroups. So I am trying to integrate hibernate…
2
votes
1 answer

AbstractMethodError after adding hibernate-seach-orm to POM

I am using Hibernate ORM together with Spring, and wanted to add Hibernate Search: An excerpt of my POM file: org.hibernate hibernate-search-orm
bwright
  • 896
  • 11
  • 29
2
votes
2 answers

Lucene count - group by query

Can Lucene counts documents after having grouped them by a NumericField? Only counting, not loading all documents content.
Slim
  • 1,256
  • 1
  • 13
  • 25
2
votes
0 answers

Getting Exception - FieldBridge for Enum Field

I am getting Exception on Enum Type field using hibernate search. Internal Server Error: javax.persistence.PersistenceException: org.hibernate.search.bridge.BridgeException: Exception while calling bridge#objectToString class:…
Mike Clark
  • 1,860
  • 14
  • 21
2
votes
0 answers

How to determine In which indexed fields a token has matched?

I search all fields of objects with "Hibernate Search". My Query: final org.apache.lucene.search.Query luceneQuery = qb .keyword().wildcard() .onFields( fields ) .matching( valueToSearch ) .createQuery(); …
2
votes
1 answer

HornetQ using JNDI / remoting when used with WildFly 8.1 cluster

Previously 2 JBoss 6 servers (master & slave) were started with 2 different IP addresses (127.0.0.1 and 127.0.0.2) and those 2 server instances were run in domain mode. The instances used HornetQ to communicate index jobs for Hibernate Search. I'm…