hibernate-search

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

两盒软妹~` 提交于 2020-01-13 07:53:07
问题 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, having routepoints (coordinates) and metadata like photos, reviews, etc. Now, I have indexed these records using Hibernate and then I search within the index using Lucene in Hibernate Search . To score my results, I build queries based on the document properties and boost them (using boostedTo() )

Hibernate NoSuchFieldError: INSTANCE

落爺英雄遲暮 提交于 2020-01-06 13:32:06
问题 I'm trying to integrate Hibernate Search with Spring Data JPA, so I wrote a sample code to test it. @PersistenceContext EntityManager em; @Override @Transactional public List<Place> findAll() { FullTextEntityManager fullTextSession = Search.getFullTextEntityManager(em); QueryBuilder builder = fullTextSession.getSearchFactory().buildQueryBuilder().forEntity(Place.class).get(); double centerLatitude = 0d; double centerLongitude = 0d; org.apache.lucene.search.Query luceneQuery = builder .spatial

Hibernate NoSuchFieldError: INSTANCE

冷暖自知 提交于 2020-01-06 13:29:37
问题 I'm trying to integrate Hibernate Search with Spring Data JPA, so I wrote a sample code to test it. @PersistenceContext EntityManager em; @Override @Transactional public List<Place> findAll() { FullTextEntityManager fullTextSession = Search.getFullTextEntityManager(em); QueryBuilder builder = fullTextSession.getSearchFactory().buildQueryBuilder().forEntity(Place.class).get(); double centerLatitude = 0d; double centerLongitude = 0d; org.apache.lucene.search.Query luceneQuery = builder .spatial

NPE while creating org.apache.lucene.search.Query

无人久伴 提交于 2020-01-06 05:43:47
问题 I wanted to make Full text Search via my Spring Boot application with the help of Hibernate Search. But I faced with such a problem: NPE while creating org.apache.lucene.search.Query . Here is my code @Repository public class HibernateSearch { @PersistenceContext private EntityManager entityManager; @Transactional public List<Manual> fulltextSearching(String keyword){ FullTextEntityManager fullTextEntityManager = org.hibernate.search.jpa.Search.getFullTextEntityManager(entityManager);

Why Hibernate Search takes so much time to build a Index?

时光怂恿深爱的人放手 提交于 2020-01-06 03:04:07
问题 I am trying to build a lucene index through hibernate search FullTextSession.createIndexer().startAndWait() but even for very little test data it won't end. Here is my code @Component("hibernateSearchMassIndexerService") public class HibernateSearchMassIndexerServiceImpl implements HibernateSearchMassIndexerService { public static final Logger log = LoggerFactory .getLogger(HibernateSearchMassIndexerServiceImpl.class); @Override @Transactional public void buildSearchIndex(Session session) {

Hibernate Search Integration with Apache Solr unable to index data

为君一笑 提交于 2020-01-04 07:35:29
问题 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 search with apache solr. I had follow this example. And did some minor changes to be compatible with new apache.lucene.core version. public class HibernateSearchSolrWorkerBackend implements BackendQueueProcessor { private static final String ID_FIELD

Hibernate Search Integration with Apache Solr unable to index data

泪湿孤枕 提交于 2020-01-04 07:35:02
问题 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 search with apache solr. I had follow this example. And did some minor changes to be compatible with new apache.lucene.core version. public class HibernateSearchSolrWorkerBackend implements BackendQueueProcessor { private static final String ID_FIELD

Hibernate Search and a complex relationship

北城余情 提交于 2020-01-01 19:58:10
问题 For design reasons, the relationship between my entities is as follows: Having entities A, B, C and AB where AB is the relationship many to many. I want to index the values of the entity C that has a many to many relationship with the B, starting from the relationship with A. So far I can index the values of A and B without problems in the following way: @Entity @Indexed public class A { @Field ... @IndexedEmbedded(depth = 2) @OneToMany(mappedBy = "a", cascade = CascadeType.ALL) private List

nHibernate.Search with nHibernate v2

醉酒当歌 提交于 2020-01-01 14:39:31
问题 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 Lucene utility). A segments file is created as well as a Fragments file etc However, when I use v 2 of nHibernate.dll & nHibernate.Search.dll then the index is not created correctly. Only a 1k segments file is created in the Index directory and Luke is unable to inspect it. The code I used in v1 was as

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

孤者浪人 提交于 2019-12-31 03:26:07
问题 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 into my app Hibernate search can work with embedded Lucene or external elastic search. External elastic search/ solr has its own benefits, but I am ok with embedded also to start with. My questions Which library is better for easy development and maintenance. I see many pros and cons of solr vs