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
3
votes
1 answer

How to handle abstract types in @IndexedEmbedded includepaths?

I'm trying to create a lucene index for a model partly consisting of abstract classes. Let's say I want to index class A, which has a method to return a list of class B elements, which all has a object of abstract class C which has an abstract…
Niek Tax
  • 841
  • 1
  • 11
  • 30
3
votes
1 answer

BooleanQuery$TooManyClauses exception when using wildcard queries

I'm using Hibernate Search / Lucene to maintain a really simple index to find objects by name - no fancy stuff. My model classes all extend a class NamedModel which looks basically as follows: @MappedSuperclass public abstract class NamedModel { …
Koraktor
  • 41,357
  • 10
  • 69
  • 99
3
votes
1 answer

(N)Hibernate.Search : Index different properties in one field

When I was using Lucene to index my entities, I had the habit of putting all my indexed properties in a field named "all", to perform a search on "all" of my entities types. Now, using NHibernate.Search, I can't find how to do this. I tried this…
mathieu
  • 30,974
  • 4
  • 64
  • 90
3
votes
2 answers

Search without accents must return words with accents

I have a web app developed with Hibernate, Spring and Java, that accesses an Informix database... Imagine you are searching for a certain record with an accent on it, like "María", but you write "Maria" in the search box... now it doesn't show any…
diminuta
  • 1,545
  • 8
  • 32
  • 55
3
votes
1 answer

hibernate search on heroku

I have an application built with Spring+JPA+Hibernate running on Heorku, and I use Hibernate-Search for FullTextSearch. On my local machine i store my indexes on file system. My configuration in persistence.xml.
maykoone
  • 31
  • 2
3
votes
1 answer

Hibernate Search indexing uncompleted Documents

I experience an issue while indexing my data in a batch. I want to index an Article list, with some @IndexedEmbedded on members where I need to get info. Article get additional infos from two others beans : Page and Articlefulltext. The batch is…
3
votes
1 answer

Spring + Hibernate Search dynamic configuraion

I'm currently trying to configure hibernate search via spring across 3 machines for the purpose of using a JMS distributed index. Due to the way we deploy our software I have to use the same configuration across all three machines but I need a way…
3
votes
2 answers

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 extends AuditableEntity implements Serializable { …
Dangling Piyush
  • 3,658
  • 8
  • 37
  • 52
3
votes
1 answer

Lucene condition AND in QueryBuilder

Personal I have a problem in a query, want to put the AND clause in a term, however I am not getting and tried searching with no success. Follow the example and return the query (I'm using to test Luke conditions upon my indece and the result are…
3
votes
2 answers

Using a common query convention for multiple search fields

Imagine that I am building a hashtag search. My main indexed type is called Post, which has a list of Hashtag items, which are marked as IndexedEmbedded. Separately, every post has a list of Comment objects, each of which, again, contains a list of…
Preslav Rachev
  • 3,983
  • 6
  • 39
  • 63
3
votes
1 answer

Getting a TransientObjectException when creating my initial index

I'm using the following code to initialize my Hibernate Search index: EntityManager em = ... FullTextEntityManager fullTextEM = Search.getFullTextEntityManager(em); fullTextEM.createIndexer().startAndWait(); Now when I execute this code, I'm…
John S
  • 1,695
  • 2
  • 14
  • 25
2
votes
2 answers

Query in Lucene

The structure of the table "testtable" is id int primary key productid int attributeid int value varchar(250) where productid is the unique id of a product, attributeid is the unique id of attribute of a product e.g. size, quality,height,…
Shashi
  • 12,487
  • 17
  • 65
  • 111
2
votes
4 answers

How to get total count in hibernate full text search?

I am trying using hibernate full text by following this link: hibernate/search/4.1/reference/en-US/html/getting-started Basically, it works, but I want to know how to get total count while I execute a full text query,then I can tell user how many…
Tom
  • 2,857
  • 9
  • 46
  • 59
2
votes
1 answer

Spring 3.1.1 + Hibernate 4.1.0 - Not indexing?

Indexing of new elements not working with Hibernate + Spring. No errors are displayed in logs. Hibernate and Spring versions: Hibernate 4.1.0.Final Hibernate Search 4.0.0.Final Hibernate EntityManager 4.0.1.Final Spring…
dmunozfer
  • 550
  • 1
  • 5
  • 16
2
votes
0 answers

Hibernate search autocomplete

I'm working on search autocomplete using Hibernate Search. My database has fields which contains a few words. Currently I'm using EdgeNGramFilterFactory, search works excellent and return whole field. However I'd like to have only the words which…
mmatloka
  • 1,986
  • 1
  • 20
  • 46