Skip to content

Instantly share code, notes, and snippets.

@hartviglarsen
Created February 28, 2019 20:17
Show Gist options
  • Select an option

  • Save hartviglarsen/0bced0cb916c1dfe76e48ab77bc2fe1b to your computer and use it in GitHub Desktop.

Select an option

Save hartviglarsen/0bced0cb916c1dfe76e48ab77bc2fe1b to your computer and use it in GitHub Desktop.
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