Question

I am trying to get a Spring Solr query using a repository and implement the following

findByXOrYAndZ

The precedence should be as follows:

(X OR Y) AND Z

I am using a SolrCrudRepository:

Page<SolrX> findByXOrYAndZ(List<String> x, Boolean y, String z);

How can I enforce the precedence?

Was it helpful?

Solution

You can use @Query to do so.

@Query("(x:(?0) OR y:?1) AND z:?2")
Page<SolrX> findByXOrYAndZ(List<String> x, Boolean y, String z);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top