On Feb 14, 2008, at 7:26 AM, matthias walter wrote:
I'm having problems using SolrQuery.add(String, String).
My Sample code is:
SolrQuery anotherQuery = new SolrQuery();
anotherQuery.add("city", cmd.getCity());
This is incorrect (though admittedly confusing) use of the SolrQuery
API. What that does is the same as making this URL query: ?
city=<cmd.getCity()>
SolrQuery is-a SolrParams.
If I do it like that:
SolrQuery query = new SolrQuery();
query.setQuery("city:" + cmd.getCity() + " AND age:24");
Everything works fine.
It's not a real problem because the second version does the job,
but the code is quite ugly.
There ya go!
Erik