Search code examples
odataiqueryablesolrnet

Where can I find a SolrNet IQueryable provider?


I am using WebApi and want to implement OData for one of my SolrNet resources.

WebApi supports OData if you return it an IQueryable. So I need an IQueryable provider for SolrNet queries.

Does anyone know of any, or some sample code of how I can get started? If there are none available my company might start an open source project for creating this.


Solution

  • Generally speaking an IQueryable is associated with a LINQ provider of some sort. I'm not sure where the community is at with LINQ-to-Solr providers. I'm not aware of anything that works today but some projects showed up in search results that you should look at before investing time in creating a LINQ provider.

    That said, you -could- simply take a list of things and call the .AsQueryable() extension method. Although it's technically easy to get an IQueryable this way, I assume you're probably looking for the OData query to be translated to a Solr query, in which case the former paragraph is the one you want to pursue.