Link to home
Start Free TrialLog in
Avatar of Lawrence Mugambi
Lawrence Mugambi

asked on

Elasticsearch Integration to Spring Boot

We are working on an e-commerce application. We are at the point of integrating Elasticsearch for the product search engine with Spring boot application with Spring data. We have tried different tutorials online (check links below) but they all doesn't run well. No indexes are added to the Elasticsearch.  We are using ES 6.3.1 and the maven dependency is as follows.

               
 <dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
		</dependency>

Open in new window


Product Entity

@Entity
@Document(indexName = "product", type="default")
public class Product {

    @javax.persistence.Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long Id;
    private String Name;
    @Lob
    @Type(type = "text")
    private String Description;
    private String ShortDescript;
    private String Model;
    private String Brand;
    private String Sku;
    private String Isbn;
    private Integer Shipping;
    private BigDecimal SalePrice;
    private BigDecimal RegularPrice;
    private Integer Quantity;
    private Double Weight;

//other code here
}

Open in new window


Product Repository

@Repository
public interface ProductRepository extends ElasticsearchCrudRepository<Product, Long> {

    @Query("select p from Product p where p.supplier.id = ?1")
    public Iterable<Product> GetAllProductsBySupplier(Long id);
   
}

Open in new window


We have installed kibana locally and have tested with test data and it works. But not with the Spring Boot application. Need your help. Thanks

1. https://www.baeldung.com/spring-data-elasticsearch-tutorial
2.https://www.mkyong.com/spring-boot/spring-boot-spring-data-elasticsearch-example/
Avatar of Kyle Santos
Kyle Santos
Flag of United States of America image

Hi,

I am here to help you with your open question.  Do you still need help?  I have the ability to alert more experts if you still need help.

If you solved the problem on your own, would you please post the solution here in case others have the same problem?

If you need me to delete this question just say "Delete."

Thank you for using Experts Exchange.

Regards,

Kyle Santos
Customer Relations
Avatar of Lawrence Mugambi
Lawrence Mugambi

ASKER

I still need help. I haven't found any good solution yet. Thanks
Thanks. I will be waiting
When you say it does not work, what exactly is the problem? Do you get an error? An Exception? Anything in the logs?
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.