I'm using solrnet library for the interaction with solr. Is there a method in solrnet that formats a required query. I have seen the NotQuery
which renders a -
(not) in the query, but I now have a need for the +
(required) in the query.
Is this possible using solrnet?
I've tried to implement a RequiredQuery
and RequiredQuerySerializer
similar to NotQuery
, but I can't get it injected into the solrnet pipeline. (I know I can modify the SolrNet sourcecode, but I'd really like to keep the solrnet binary unmodified.)
The easiest way is to have RequiredQuery
implement ISelfSerializingQuery
(example).
A separate serializer is used for more complex cases, or to keep things neater. When using a separate ISolrQuerySerializer
, register in your IoC container an AggregateQuerySerializer
that includes both your serializer and the DefaultQuerySerializer
.