Hibernate search - convert sql to lucene query

I have the below select SQL query

SELECT * FROM data_entity WHERE 
agreement_number='9999' AND use_type='xxxx' AND end_date IS NOT NULL AND end_date <= '2022-05-03'::date 
OR (rib='1111111' AND iban='22222222');

I want to convert it to query using hibernate search, i tried with the below query, but it doesn’t give me the right result, can anyone see what can be the problem with the query?

@Entity
@Indexed
 public class DataEntity {

    @Id
    private String id;

    @Field
    private String agreementNumber;

    @Field
    private String useType;

    @Field
    @DateBridge(resolution = Resolution.DAY)
    private Date endDate;

    @Field
    private String rib;

    @Field
    private String iban;
    
}

org.apache.lucene.search.Query firstQuery = getQuery().bool()
    .must(getQuery().bool()
        .must(getQuery().keyword().onField("agreementNumber").matching(agreementNumber).createQuery())
        .must(getQuery().keyword().onField("useType").matching(useType).createQuery())
        .must(getQuery().range().onField("endDate").above(effectiveDate).createQuery()).createQuery())
    .should(getQuery().bool()
        .must(getQuery().keyword().onField("rib").matching(rib).createQuery())
        .must(getQuery().keyword().onField("iban").matching(iban).createQuery()).createQuery())
        .createQuery();

Looks like this was crossposted from stack overflow: https://stackoverflow.com/questions/63374039/hibernate-search-cconvert-sql-to-lucene-query/63446326#63446326

Closing this topic and answering there.