I have been building Solr queries manually as strings and passing them to SolrNet. The queries can be complicated combinations of ANDs and ORs like this. Note that I am using eDisMax to allow for the complex nested query.
_query_:"field1:[1 TO 10] OR
field2:[1 TO 10] OR
field3:[1 TO 10]"
AND
_query_:"field4:(keyword)"
AND
_query_:"field5:(keyword)"
This was working well, but looking into the API for SolrNet, I see there are objects I could use for each clause and then pull these objects together to form the complete query. I would much rather implement this with that approach than build and concatenate the strings.
The API is well documented for ANDs and ORs but I need to have the ANDs and ORs grouped to handle the sitations like above--things like (a OR b) AND (c OR d).
--
You received this message because you are subscribed to the Google Groups "SolrNet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to solrnet+u...@googlegroups.com.
To post to this group, send email to sol...@googlegroups.com.
Visit this group at http://groups.google.com/group/solrnet.
For more options, visit https://groups.google.com/groups/opt_out.
var aAndB = new SolrMultipleCriteriaQuery(new[] {new SolrQuery("a"), new SolrQuery("b")}, "OR") var cAndD = new SolrMultipleCriteriaQuery(new[] {new SolrQuery("c"), new SolrQuery("d")}, "OR")
Then I join these together this way: var result = new SolrMultipleCriteriaQuery(new[] {new SolrQuery("aAndB"), new SolrQuery("cAndD")}, "AND")
--
You received this message because you are subscribed to the Google Groups "SolrNet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to solrnet+u...@googlegroups.com.
To post to this group, send email to sol...@googlegroups.com.
Visit this group at http://groups.google.com/group/solrnet.
For more options, visit https://groups.google.com/d/optout.
ISolrOperations<Product> solr = ...
var products = solr.Query(new LocalParams {{"type", "dismax"},{"qf", "myfield"}} + new SolrQuery("solr rocks"));ISolrOperations<Dictionary<string, object>> solr = ...
--