Quantcast
Channel: Spring Community Forums - NoSQL
Viewing all articles
Browse latest Browse all 128

Spring Data Solr Criteria Exception

$
0
0
In solr admin interface I have this query

Code:

text: nose AND (text:heart OR text:core)
which runs fine

In the java code I have

Code:

import static org.springframework.data.solr.core.query.Criteria.*;
...

                Criteria cr = new Criteria().and(
                                where("text").is("nose"),
                                where("text").is("heart").or("text").is("core")
                );

The above throws:
Code:

java.lang.IllegalArgumentException: Cannot add criteria for null field.
        at org.springframework.util.Assert.notNull(Assert.java:112)
....

Is this a bug or how would I build the criteria to match the above query

Viewing all articles
Browse latest Browse all 128

Trending Articles