0

I want to use Elasticsearch to speed up searching for records using Primefaces datatable's filter with Lazy loading.

https://www.primefaces.org/showcase/ui/data/datatable/filter.xhtml

https://www.primefaces.org/showcase/ui/data/datatable/lazy.xhtml

Currently we create a JPA Criteria Query that searches for the entered text in all the columns in the relating PostgreSQL table (In the LazyDataModel instance). This ends up creating a HUGE sql query that, in some cases, takes very long to execute.

Now for my question: Is this a good idea? If so, what would be the best way to implement Elasticsearch properly in the LazyDataModel?

Max
  • 1,107
  • 12
  • 24
  • This question is in no way jsf or PrimeFaces related. If you have good separation of concerns, this is done in a service layer and PF has no knowledge about using whatever db technology. Try to get it to work in a simple unittest and you have the solution – Kukeltje May 13 '17 at 11:16
  • @Kukeltje Thank you for letting me know that i'm barking up the wrong tree. I focused my research more toward the db technology and found that Hibernate provides a near seemless integration with Elasticsearch. https://docs.jboss.org/hibernate/search/5.6/reference/en-US/html/ch11.html Unfortunately I am using EclipseLink - might have to migrate to Hibernate for this. – Max May 13 '17 at 20:24
  • This also helped me - using logstash's jdbc input plugin now. https://stackoverflow.com/questions/34477095/elasticsearch-replication-of-other-system-data/34477639#34477639 – Max Sep 25 '17 at 18:30

0 Answers0