Last active
March 9, 2020 21:22
-
-
Save fabriciosanchez/355b5823b5509a331dbc51a263d840a4 to your computer and use it in GitHub Desktop.
This file contains 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
private async Task<ActionResult> RunQueryAsync(SearchData model) | |
{ | |
InitSearch(); | |
var parameters = new SearchParameters | |
{ | |
// Enter content property names into this list so only these values will be returned. | |
// If Select is empty, all values will be returned, which can be inefficient. | |
Select = new[] { "Column1", "Column2", "ColumnN" } | |
}; | |
try | |
{ | |
model.resultList = await _indexClient.Documents.SearchAsync<Content>(model.searchText, parameters); | |
} | |
catch (Exception e) | |
{ | |
throw new Exception(e.Message); | |
} | |
// Display the results. | |
return View("Index", model); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment