hibernate-search

Hibernate search “join” on TextFullSearch

落爺英雄遲暮 提交于 2019-12-11 14:17:35
问题 I have 2 entities : Ad and Category; I have a FullTextSearch (lucene) on Ad entity and I want to make a "join" beetween Ad And Category or to add somehow a where clause on Ad.category.id . My Add class : @Entity @Indexed @Table(name = "adds") public class Ad implements Serializable { @Id @SequenceGenerator(name="AdSQ", sequenceName="AdSQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "AdSQ") @Column(name = "id") @JsonProperty("Id") private Long __Id;

Hibernate Search: configure Facet for custom FieldBridge

为君一笑 提交于 2019-12-11 13:13:56
问题 In this example DateSplitBridge.java dynamic fields are added to indexed document: public class DateSplitBridge implements FieldBridge { ... public void set(String name, Object value, Document document, LuceneOptions luceneOptions) { ... luceneOptions.addFieldToDocument( name + ".year", String.valueOf( year ), document); ... How do I configure Facet for such ad hoc fields? Can it be done in FieldBridge itself? 回答1: Solution was found in https://hibernate.atlassian.net/browse/HSEARCH-1686?page

Spring Boot, Hibernate Search properties

£可爱£侵袭症+ 提交于 2019-12-11 09:04:24
问题 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

How to do SQL IN like query in hibernate search

倾然丶 夕夏残阳落幕 提交于 2019-12-11 08:47:51
问题 A simulating scenario is: Search for books whose content contains "success" AND author is in a list of passed names(could be thousands of). I looked into filter: http://docs.jboss.org/hibernate/stable/search/reference/en-US/html_single/#query-filter Seams like hibernate search has no native support of this. What is recommended approach for this problem? I think I am not alone. Thanks for any inputs. 回答1: Let me post my current solution. Get the search results with minimal projections for the

Set dynamic index directory for Hibernate Search in Spring

烈酒焚心 提交于 2019-12-11 07:27:39
问题 This has been discussed already, however none of the solutions/advices worked for me. I want to configure the lucene search index path in Spring via persistence.xml. This is important, since the deployment server is (of course) different from my local machine, so paths will not match. Right now, my configuration of hibernate-search inside the persistence.xml looks like this: <property name="hibernate.search.default.directory_provider" value="filesystem" /> <property name="tempdir" value="#{

How to do case insensitive sorting of Norwegian characters (Æ, Ø, and Å) using Hibernate Lucene Search?

喜欢而已 提交于 2019-12-11 06:37:51
问题 æ, ø, å are latest letters in the norwegian alphabet A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Æ Ø Å When we try to sort it using Hibernate Lucene then Å clubs with A , Ø clubs with Ø , Æ clibs with A which is wrong. For example: Currrent Results: Aaalu, Åaalu, Baalu, Zaalu, Expected Results: Aaalu, Baalu, Zaalu, Åaalu, Following is working code: @AnalyzerDef(name = "myOwnAnalyzer", tokenizer = @TokenizerDef(factory = KeywordTokenizerFactory.class), filters = { @TokenFilterDef

Hibernate Search- How To get Matching Field Names

风格不统一 提交于 2019-12-11 06:07:37
问题 I have implemented hibernate lucene search in my JSP project. I can search contact_name,contact_email(one To Many),etc.,as a result it will return the list of contacts which matching to the search keyword successfully. But My problem is i want to know in which field(columnn_name) the 'match found'. Is there any way to grab the matching field name along with result. This is how i wrote the search query and getting result List<Contact> searchResultContact = new ArrayList<Contact>();

hibernate-search for one-directional associations

。_饼干妹妹 提交于 2019-12-11 05:36:00
问题 According to the spec, when @IndexedEmbedded points to an entity, the association has to be directional and the other side has to be annotated with @ContainedIn. If not, Hibernate Search has no way to update the root index when the associated entity is updated . Am I right to assume the word directional should be bi-directional ? I have exactly the problem that my index is not updated. I have one-directional relationships, e.g. person to order but the order does not know the person. Now when

What is the Best method to access hiberante search (lucene) files on amazon s3

我怕爱的太早我们不能终老 提交于 2019-12-11 04:09:28
问题 I am using amazon s3 to host my website (so far - very impressed), however, I want to host my hibernate search index files and subdirectories in a manner that will scale. Could I use the Amazon s3 buckets for this? I already host user uploaded images here? I have tried simply pointing the hibernate.search.default.indexBase at the appropriate url but it throws a write exception. Any help appreciated! 回答1: The indexBase configuration property expects an absolute filesystem path. S3 "scales"

java.lang.ClassNotFoundException: org.hibernate.annotations.common.reflection.ClassLoadingException

五迷三道 提交于 2019-12-11 03:28:50
问题 I use spring junit tests, but I get this error message in all tests, since I updated my Hibernate Search, Hibernate and Springframework. In pom.xml I included common.annotations from Hibernate and i can also find it in my library (maven dependency), which should have been included in the classpath. But it seems like that my tests can still not find the class. Here is the pom.xml config: <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>4.3