CategoryElasticsearch

Multilanguage searching with Elasticsearch

This time I’ll start directly with the code.  First an utility method to create the connection: 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); } And here’s the interesting part: public IEnumerable<SearchItem> Search(string text, int page, int pageSize, IEnumerable<string> […]

Categories: Elasticsearch, Programming

© 2020 Davide Guida

Theme by Anders NorenUp ↑