Reputation: 79
in this code I'm searching the word 'the gimme' from the field 'name'
SolrQuery slrQuery = new SolrQuery("name:the gimme");
System.out.println(slrQuery.toString());
the result q=name%3Athe+gimme
so the space characters was transformed to '+', solr return the fields that have the word 'the' or 'gimme' but I need filds have only 'the gimme'
can I have a solution? Thanks.
Upvotes: 0
Views: 636
Reputation: 13394
You have to decide between search and "phrased search".
If you like to match the exact term the gimme
you have to use phrased search.
How this works depends on the query parser, you are using.
Try:
SolrQuery slrQuery = new SolrQuery("name:\"the gimme\"");
Upvotes: 1