Ankita Ankita - 1 year ago 82
C# Question

solrnet query to get filter for boolean type field indexed to solr

I have indexed products with stocks availability.

It means if products have stock then stock availability field has value "true" otherwise "false".

Now if I select any category, on Category page I want a filter for "Excluding Out of Stock", same as flip kart do.

I can do this in solr?

How can I perform solrnet query to get this work?

Answer Source

I do the following thing and pass a solrnet query and it works for me.

 List<ISolrQuery> _solrQuery = new List<ISolrQuery>();
_solrQuery.Add(new SolrQueryByField("StockAvailability", "true"));
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download