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?