hibernate-search

Hibernate Search Order by child-count

冷暖自知 提交于 2019-12-02 08:36:51
Consider: @Indexed @Entity public class TParent implements java.io.Serializable { ..... private Set<TChild> TChildSet = new HashSet<TChild>(0); @ContainedIn @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="TParent") public Set<TChild> getTChildSet() { return this.TChildSet; } A query would be something like this: FullTextQuery hibQuery = fullTextSession.createFullTextQuery( luceneQuery ); hibQuery.setSort( ... ) How can a sort-by-child-count be achieved? In other words, the order of the TParent list returned would be dictated by the TChildSet count. I know an @Formula can be

Spring Boot, Hibernate Search properties

偶尔善良 提交于 2019-11-30 16:20:39
How to provide Hibernate Search parameters when using Spring Boot? ... spring.datasource.driverClassName=org.postgresql.Driver hibernate.search.jmx_enabled=true hibernate.search.default.directory_provider=filesystem hibernate.search.generate_statistics=true hibernate.search.lucene_version=LUCENE_CURRENT hibernate.search.default.indexBase=/mypath-to-index It does not care what I provide. Default settings always get applied. I think below code does not have anything to process properties related to Hibernate Search. Can that be the issue? https://github.com/spring-projects/spring-boot/blob

Spring Boot, Hibernate Search properties

寵の児 提交于 2019-11-30 16:06:23
问题 How to provide Hibernate Search parameters when using Spring Boot? ... spring.datasource.driverClassName=org.postgresql.Driver hibernate.search.jmx_enabled=true hibernate.search.default.directory_provider=filesystem hibernate.search.generate_statistics=true hibernate.search.lucene_version=LUCENE_CURRENT hibernate.search.default.indexBase=/mypath-to-index It does not care what I provide. Default settings always get applied. I think below code does not have anything to process properties

Solr vs Hibernate Search - Which to choose and When?

会有一股神秘感。 提交于 2019-11-29 22:18:24
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 across Hibernate Search and Apache Solr . Can someone list out the pros and cons of both of them so that we can select the ideal solution for Enterprise Search? Apache Solr is mainly used for full text search: if you want to find words (singular and plurals for example) in a big set of documents where the size of each doc is from one paragraph to a few pages. Solr may not be better than a regular

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

眉间皱痕 提交于 2019-11-28 00:59:22
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-impl/jars/jsf-impl-2.0.0.jar org.apache.myfaces.orchestra/myfaces-orchestra-core20/jars/myfaces-orchestra-core20-1.5-SNAPSHOT.jar commons-lang/commons-lang/jars/commons-lang-2.1.jar commons-logging/commons-logging/jars/commons-logging-1.1.1.jar org.springframework/spring/jars/spring-2.5.6.jar commons-el/commons-el/jars/commons-el-1.0.jar org.richfaces.ui/richfaces-ui/jars/richfaces-ui-3.3.3.Final

Hibernate Search | ngram analyzer with minGramSize 1

被刻印的时光 ゝ 提交于 2019-11-27 16:26:42
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 be able to find a entity by searching for just one character (because it could be possible, that a hospital has single character name). @Indexed(index = "HospitalIndex") @AnalyzerDef(name = "ngram", tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class), filters = { @TokenFilterDef(factory = StandardFilterFactory.class), @TokenFilterDef(factory = LowerCaseFilterFactory.class),

Hibernate Search: How to use wildcards correctly?

大城市里の小女人 提交于 2019-11-27 15:55:39
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.getId()) .createQuery()); for(String term: terms) if(!term.equals("")) mj.must(qb.keyword() .onField("fullName") .matching(term+"*") .createQuery()); And it is working perfectly, but only if the user types the full firstname and/or lastname of the patient. However I would like to make if work even if the user types a part of the firstname or lastname. For example, if there's a patient called "Bilbo Baggins

How to search between dates (Hibernate Search)?

♀尐吖头ヾ 提交于 2019-11-27 06:14:50
问题 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 analysis started. */ @Temporal(TemporalType.TIMESTAMP) @Field(index = Index.UN_TOKENIZED) @DateBridge(resolution = Resolution.MILLISECOND) private Date startTS; My requirment is to find the records analysed between a two dates eg. 11/11/2011 to 11/11/2012.I am confused how to do this. 回答1: You should use a range

Hibernate Search | ngram analyzer with minGramSize 1

强颜欢笑 提交于 2019-11-26 22:28:32
问题 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 be able to find a entity by searching for just one character (because it could be possible, that a hospital has single character name). @Indexed(index = "HospitalIndex") @AnalyzerDef(name = "ngram", tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class), filters = { @TokenFilterDef