You can try something like:
//Create a Search Context to the "indexname" Index (could be SOLR/Lucene/something else)
using (var context = new ContentSearchManager.GetIndex("indexname").CreateSearchContext())
{
//LINQ Query
var query = context.GetQueryable<SomeType>.Where(i => i.Name.StartsWith("Something"));
}
//Disposal due to IDisposable
Also you can check this link