Created
March 30, 2015 00:42
-
-
Save gbellmann/68099cb3d38cdd13d330 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
public IEnumerable<Pelicula> SearchDocuments(SearchIndexClient indexClient, string searchText, string filter = null) | |
{ | |
// Ejecutamos la búsqueda basada en un texto de búsqueda y filtros opcionales | |
var sp = new SearchParameters(); | |
if (!String.IsNullOrEmpty(filter)) | |
{ | |
sp.Filter = filter; | |
} | |
DocumentSearchResponse<Pelicula> response = indexClient.Documents.Search<Pelicula>(searchText, sp); | |
foreach (SearchResult<Pelicula> result in response) | |
{ | |
yield return result.Document; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment