hibernate-search

Lucene Analyzer for Indexing and Searching

主宰稳场 提交于 2019-12-23 17:05:17
问题 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 HUNGRY, SLIGHTLY_HUNGRY, and NOT_HUNGRY When these values are indexed using the StandardAnalyzer , the terms end up as hungry, slightly since it tokenizes on punctuation and ignores the "not". If I change the index to index=Index.UN_TOKENIZED , the indexed terms are HUNGRY, SLIGHTLY_HUNGRY, and NOT

hibernate search + spring3 + jpa

我的梦境 提交于 2019-12-23 15:33:20
问题 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, but nothing I do seems to work. Domain object: @Entity @Table(name = "roles") @Indexed public class Role implements GrantedAuthority { private static final long serialVersionUID = 8227887773948216849L; @Id @GeneratedValue @DocumentId private Long ID; @Column(name = "authority", nullable = false

Indexing huge table with Hibernate Search

好久不见. 提交于 2019-12-23 05:32:05
问题 I'm trying to add Hibernate Search to my project to improve search performance, but I have problem with Indexing huge tables. I've added Hibernate Search dependency and I have simple servlet where I trigger indexing process: FullTextEntityManager ftem = Search.getFullTextEntityManager(em); try { ftem .createIndexer(MyEntity.class) .batchSizeToLoadObjects(25) .cacheMode(CacheMode.NORMAL) .threadsToLoadObjects(5) .startAndWait(); } catch (InterruptedException e) { e.printStackTrace(); } and in

EntityManagerHolder cannot be cast to org.springframework.orm.hibernate5.SessionHolder

落花浮王杯 提交于 2019-12-22 18:37:41
问题 I'm using this code to configure Spring with Hibernate: @SpringBootApplication @Configuration @EnableTransactionManagement public class ContextServer { @Bean public LocalSessionFactoryBean getSessionFactory() { LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean(); try { sessionFactory.setDataSource(dataSource()); } catch (NamingException e) { e.printStackTrace(); } sessionFactory.setPackagesToScan(new String[] { "org.plugin.database.models" }); sessionFactory

ElasticSearch - define custom letter order for sorting

守給你的承諾、 提交于 2019-12-22 13:49:07
问题 I'm using ElasticSearch 2.4.2 (via HibernateSearch 5.7.1.Final from Java). I have a problem with string sorting. The language of my application has diacritics, which have a specific alphabetic ordering. For example Ł goes directly after L , Ó goes after O , etc. So you are supposed to sort the strings like this: Dla Dła Doa Dóa Dza Eza ElasticSearch sorts by typical letters first, and moves all strange letters to at the end: Dla Doa Dza Dła Dóa Eza Can I add a custom letter ordering for

Hibernate HQL query does not update the Lucene Index

断了今生、忘了曾经 提交于 2019-12-22 12:18:10
问题 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 completes. Here is the query: Session session = factory.getCurrentSession(); Query q = session.createQuery("delete from Charges cg where cg.id in (:charges)"); q.setParameterList("charges", chargeIds); int result = q.executeUpdate();` What am I missing? What do I need to do to solve issue? I

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

回眸只為那壹抹淺笑 提交于 2019-12-22 10:26:48
问题 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 enabled on this cache. interface org.hibernate.search.spi.SearchFactoryIntegrator not found in registry Long Version: JBoss version: 7.1.1 FINAL Infinispan version: 5.16 (upgraded from 5.1.2 JBoss ships with in attempts to solve issue) Java Version: 1.7 I am attempting to build a simple test

Query in Lucene

自闭症网瘾萝莉.ら 提交于 2019-12-22 01:29:07
问题 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, color and 'value' is the value for the attribute i have to filter a result. I achieve the requirement by this query. But i am not able to make it in a query. select a.* from dbo.testtable a where a.attributeId=10 and a.[Value]='Romance' and productId in (

Infinispan distributed cluster with shared index

孤人 提交于 2019-12-21 23:27:12
问题 Does anybody have a working example of how to configure a cluster of nodes to share an index using the infinispan directory provider? All the documentation on Infinispan (the documentation is seriously lacking btw) implies that it should be as easy as having some properties set but no matter how I try I cannot get it to work. The nodes in the cluster find eachother fine and I can do get operations on one node and get object that were put on another. But as soon as I do queries (use the index)

Use existing analyzer in hibernate search AnalyzerDiscriminator

十年热恋 提交于 2019-12-21 18:34:02
问题 @Entity @Indexed @AnalyzerDefs({ @AnalyzerDef(name = "en", tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class), filters = { @TokenFilterDef(factory = LowerCaseFilterFactory.class), @TokenFilterDef(factory = EnglishPorterFilterFactory.class ) }), @AnalyzerDef(name = "de", tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class), filters = { @TokenFilterDef(factory = LowerCaseFilterFactory.class), @TokenFilterDef(factory = GermanStemFilterFactory.class) }) }) public