Domanda

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?

È stato utile?

Soluzione

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);
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top