spring-data-elasticsearch

ElasticSearch : Can we apply both n-gram and language analyzers during indexing

只愿长相守 提交于 2020-01-21 20:13:28
问题 Thanks a lot @Random , I have modified the mapping as follows. For testing I have used "movie" as my type for indexing. Note: I have added search_analyzer also. I was not getting proper results without that. However I have following doubts for using search_analyzer. 1] Can we use custom search_analyzer in case of language analyzers ? 2] am I getting all the results due to n-gram analyzer I have used and not due to english analyzer? { "settings": { "analysis": { "analyzer": { "english_ngram":

ElasticSearch : Can we apply both n-gram and language analyzers during indexing

孤人 提交于 2020-01-21 20:12:22
问题 Thanks a lot @Random , I have modified the mapping as follows. For testing I have used "movie" as my type for indexing. Note: I have added search_analyzer also. I was not getting proper results without that. However I have following doubts for using search_analyzer. 1] Can we use custom search_analyzer in case of language analyzers ? 2] am I getting all the results due to n-gram analyzer I have used and not due to english analyzer? { "settings": { "analysis": { "analyzer": { "english_ngram":

elasticsearch: return TotalPages not correct

好久不见. 提交于 2020-01-06 02:35:09
问题 I have 107 documents in my index base, i created a method to return all these documents with pagination, in my case the first page contains 20 documents and i logically get 6 pages, the 5 first pages contain 20 documents each and the 6th page contains only 7. The problem is that the methods reeturn always 1 page not 6 @Override @Transactional(readOnly = true) public Page<Convention> findAll(Pageable pageable) throws UnknownHostException { String[] parts = pageable.getSort().toString().split("

spring-data-elasticsearch searching over multiple indices

╄→尐↘猪︶ㄣ 提交于 2020-01-01 03:50:06
问题 i have a searchfield on my page and this searchfield should search over more than one indice. I can search for one indice without a problem, like described in the documentation of spring-data-elasticsearch. But if i search, as example for "Foo", i want to have the following list as result ordered by relevance: { title: "Foo" } -> Entity: Sample { name: "FooTest" } -> Entity: Test { title: "FooSample2" } -> Entity: Sample // ...and so on // The entities are not part of the same parent. So,

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

Spring Data Elasticsearch: Multiple Index with same Document

孤街浪徒 提交于 2019-12-30 16:37:27
问题 I'm using spring-data-elasticsearch and for the beginning everything works fine. @Document( type = "products", indexName = "empty" ) public class Product { ... } public interface ProductRepository extends ElasticsearchRepository<Product, String> { ... } In my model i can search for products. @Autowired private ProductRepository repository; ... repository.findByIdentifier( "xxx" ).getCategory() ); So, my problem is - I've the same Elasticsearch type in different indices and I want to use the

How do you use both Spring Data JPA and Spring Data Elasticsearch repositories on the same domain class in a Spring Boot application?

感情迁移 提交于 2019-12-30 03:15:06
问题 I'm trying to use both Spring Data JPA and Spring Data Elasticsearch on the same domain object but it doesn't work. When I tried to run a simple test, I got the following exception: org.springframework.data.mapping.PropertyReferenceException: No property index found for type Person! at org.springframework.data.mapping.PropertyPath.(PropertyPath.java:75) ~[spring-data-commons-1.11.0.RELEASE.jar:na] at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:327) ~[spring-data

Elasticsearch NoNodeAvailableException issue

泪湿孤枕 提交于 2019-12-25 08:50:11
问题 Our spring boot app is indexing data in ES cluster using transport client [using ElasticsearchRepository ]. Issue is that after some index call indexing just hangs the.the SAVE method on DAO just hangs and After some time it gives us " Nonodefoundexception " Here’s our stack ES 1.7.3 Spring Boot: 1.3.2.RELEASE Java: 1.8 spring-boot-starter-data-elasticsearch : 1.3.2.RELEASE Using transport client: ES setup: - there are three nodes. all are client and master and data Environment: Our dev is in

Spring boot Elasticsearch: Geo Point not creating correct mapping. Fails on searching

不想你离开。 提交于 2019-12-24 19:24:06
问题 I'm using Elasticsearch for Geo searches. I have written code to generate random points (lat-lng) within a limit from a centre point. This is inserted into an index, on which the search happens later on. Versions: Spring Boot: 2.2.1.RELEASE Spring Data Elastic Search: (spring-boot-starter-data-elasticsearch) 2.2.1.RELEASE ElasticSearch: org.elasticsearch : 6.8.4 pom.xml <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.1

ElasticsearchTemplate retrieve big data sets

我与影子孤独终老i 提交于 2019-12-24 19:19:28
问题 I am new to ElasticsearchTemplate. I want to get 1000 documents from Elasticsearch based on my query. I have used QueryBuilder to create my query , and it is working perfectly. I have gone through the following links , which states that it is possible to achieve big data sets using scan and scroll. link one link two I am trying to implement this functionality in the following section of code, which I have copy pasted from one of the link , mentioned above. But I am getting following error :