Skip to content

Instantly share code, notes, and snippets.

@RyanABailey
Created November 6, 2015 03:11
Show Gist options
  • Select an option

  • Save RyanABailey/96cfa2bcc08427de77c6 to your computer and use it in GitHub Desktop.

Select an option

Save RyanABailey/96cfa2bcc08427de77c6 to your computer and use it in GitHub Desktop.
Lucene computed field search code
var index = ContentSearchManager.GetIndex("MySearchIndex");
using (var context = index.CreateSearchContext())
{
var searchResults = context.GetQueryable<SearchItem>().Where(x => x.ThumbnailUrl != null)
}
public class SearchItem
{
[IndexField("thumbnail")]
public string ThumbnailUrl { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment