hibernate-search

Hibernate search to find partial matches of a phrase

廉价感情. 提交于 2019-12-12 01:57:07
问题 In my project we are using hibernate search 4.5 with lucene-analyzers and solar. I provide a text field to my clients. When they type in a phrase I would like to find all User entities whose names include the given phrase. For example consider having list of entries in database with following titles: [ Alan Smith, John Cane, Juno Taylor, Tom Caner Junior ] jun should return Juno Taylor and Tom Caner Junior an should return Alan Smith , John Cane and Tom Caner Junior @AnalyzerDef(name =

Date range query with lucene

会有一股神秘感。 提交于 2019-12-12 01:42:30
问题 I am trying to take data between specific date ranges from mssql db. But returns nothing. I found a solution here on stackoverflow but it is not working. Here what I have done : This is the date field from the entity class: @Basic(optional = false) @Column(name = "tarih") @Temporal(TemporalType.TIMESTAMP) @DateBridge(resolution = Resolution.MILLISECOND) private Date tarih; This is how I am trying to take date between specific dates: SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM

Lucene hibernate search NumericRangeQuery<Float> not working on field defined with @NumericField

北城余情 提交于 2019-12-11 20:08:24
问题 I use hibernate search 4.1.0 with good results except for this problem. I´m trying to perform a range search in a column defined: @Field(name = "startTime", store = Store.YES) @NumericField public Float startTime; I have stored an item with startTime = 0.0f; then I try to perform a range query: NumericRangeQuery<Float> rangeQuery = NumericRangeQuery.newFloatRange( "startDate", -100000.0f, +100000.0f, true, true); FullTextQuery fullTextQuery = fullTextEntityManager .createFullTextQuery

Add faceting over multivalued to application using Hibernate Search

ⅰ亾dé卋堺 提交于 2019-12-11 19:13:48
问题 we use Hibernate Search in our application. We use faceting. Recently we have found a big limitation. Faceting over fields that can have multiple values doesn't work properly with Hibernate Search - if a document has multiple values for faceted field (ex. multiple categories), only one of the values is taken into account. I can currently think of a couple two solutions: use bobo-browse (http://code.google.com/p/bobo-browse/) solr (http://lucene.apache.org/solr/) In both solutions we continue

How to set Hibernate Lucene index to be pointed to shared location.(so no index generated in local server)

二次信任 提交于 2019-12-11 18:49:35
问题 In my application I am going to implement hibernate lucene. My application will be deployed in clustered environment. Now, I am not able to find out how, I can point out the location of all the lucene index to a shared location. So it can be accessed through the network. 回答1: You can, but it's not as simple as having a shared directory: two instances of your application cannot access the same index files simultaneously. Thus, the preferred solution is generally to: Have only one "master" node

Is there a way in hibernate-search to facet by fields where the search term was found?

淺唱寂寞╮ 提交于 2019-12-11 17:25:26
问题 Consider the following indexed entity: @Entity @Indexed public class Document { ... @Field private String title; @Field private String text; } Is there a way to present user a facet that will contain two options title and text with a count of documents where the search term was found in title and text respectively? And the user should be able to select these options to search only by interesting fields. For example, there are three documents: { "title" : "One", "text" : "One" } { "title" :

Elasticsearch integration with Hibernate Search

跟風遠走 提交于 2019-12-11 15:26:42
问题 I am trying to integrate Elasticsearch with Hibernate Search. For this i have upgraded some versions: JDK version 1.7 to 1.8 Hibernate ORM version 4.1.9 to 5.2.12 Hibernate Search version 4.0.0 to 5.8.1 While runnint tests I am getting an error: Code: Caused by: java.util.ServiceConfigurationError: org.hibernate.search.bridge.spi.IndexManagerTypeSpecificBridgeProvider: Provider org.hibernate.search.elasticsearch.bridge.impl.ElasticsearchBridgeProvider not a subtype at java.util.ServiceLoader

Typeahead search not working for multiple words(with space) through Lucene/Hibernate Search query on Elastic search with analyzers

一个人想着一个人 提交于 2019-12-11 15:17:02
问题 Below is my configurations and code. Basically I'm trying to fetch record from ES Indexes with typeahead search. Though single word search is working as expected, but only on a single field, the multi word search is not working at all. My requirement is to fetch record basis on my searched word after searching for it on multiple fields. For example, if I search a name "Jason K Smith", the query should run on all the fields(name, address, second name, last name and so on...) as the searched

@IndexedEmbedded and @ContainedIn relationship not working

元气小坏坏 提交于 2019-12-11 15:16:44
问题 Data from one index "A" should be updated to another index "B" while using the @IndexedEmbedded and @ContainedIn relationship. But still the entity containing the @IndexedEmbedded annotation is not updated with data from entity containing the @ContainedIn annotation. Not sure, what I'm doing wrong. But as per documentation, this should work. Once I update A the same should reflect on B. The Elastic DB structure is, I believe fine. But the index is empty. But the HibernateMasterSearchIndex is

@Transient with @Field annotated field not showing in index on elastic server

房东的猫 提交于 2019-12-11 15:08:49
问题 Using Hibernate Search 5.9 and elastic server 5.6.10. I'm trying to persist data from 3 fields into a single field with @Transient annotation. But though the fields shows up in the index structure, the same does not show up when I query the index with curl/chrome. Its not present on the index and the data is lost this way. Code: @Transient @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES) private String fullAgentNumber = ""; public String getFullAgentNumber() { return this.fillr1