Search code examples
c#asp.net-mvcsolrnet

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?


Solution

  • 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"));