Multilanguage searching with Elasticsearch

This time I’ll start directly with the code.  First an utility method to create the connection: [csharp] private ElasticClient Connect(IEnumerable contents) { var defaultLanguageCode = "eng"; var uri = new System.Uri(ConfigurationManager.AppSettings["ElasticSearchServer"]); var settings = new ConnectionSettings(uri).SetDefaultIndex(defaultLanguageCode); var client = new ElasticClient(settings); } [/csharp] And here’s the interesting part: [csharp] public IEnumerable<SearchItem> Search(string text, int page, […]

Categories: Elasticsearch, Programming

© 2020 Davide Guida

Theme by Anders NorenUp ↑