Created
November 6, 2015 03:11
-
-
Save RyanABailey/96cfa2bcc08427de77c6 to your computer and use it in GitHub Desktop.
Lucene computed field search code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var index = ContentSearchManager.GetIndex("MySearchIndex"); | |
| using (var context = index.CreateSearchContext()) | |
| { | |
| var searchResults = context.GetQueryable<SearchItem>().Where(x => x.ThumbnailUrl != null) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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