We are using Solrnet to issue a compound query to Solr based on a set of options that the user can select for e.g. phrase, exact phrase. exclusion, proximity, etc. We are creating the individual queries based on the options selected using the SolrQueryByField API and combining the combination using a SolrMultipleCriteriaQuery with the AND operator. But when we submit the query to Solr, the q parameter that gets submitted is having the + sign added accross all the terms:
q=(ContentSearch:(roman)+AND+ContentSearch:("test+case")+AND+-ContentSearch:(wine)+AND+(ContentSearch:(A)+OR+ContentSearch:(B))+AND+ContentSearch:("catacombs+wine"~5)+AND+ContentSearch:([10+TO+20]))}
The +AND+ or "test+case" or +AND+- or 10+TO+20 is messing up the query parser. Has anybody encountered this before? Is it something to do with the url encoding when solrnet is sending the request to solr?
If you are using SolrNet 0.4.0 you can set an optional parameter on the SolrQueryByField Quoted=false
this will stop the default behavior of QueryByField to escape special characters.