Created
February 28, 2019 20:17
-
-
Save hartviglarsen/0bced0cb916c1dfe76e48ab77bc2fe1b to your computer and use it in GitHub Desktop.
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 TextPageController : RenderMvcController | |
| { | |
| private readonly IExamineManager _examineManager; | |
| public TextPageController(IExamineManager examineManager) | |
| { | |
| _examineManager = examineManager; | |
| } | |
| public ActionResult TextPage(ContentModel model) | |
| { | |
| var vm = new TextPageViewModel(model.Content); | |
| if (_examineManager.TryGetIndex("ExternalIndex", out var index)) | |
| { | |
| var searcher = index.GetSearcher(); | |
| vm.Results = searcher.CreateQuery().NodeTypeAlias("textPage").Execute(); | |
| } | |
| return CurrentTemplate(vm); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment