Skip to main content

Posts

Showing posts from March, 2017

ElasticSearch

Basic of elasticsearch go to https://www.elastic.co/ Chrome plugin for elasticsearch: Go to add extention and search for sense  Enable debug of NEST lib: Create elasticClient from following code: var node = new Uri(nodeUrl); var settings = new ConnectionSettings(node).DefaultIndex(index).DisableDirectStreaming() .OnRequestCompleted(details => { Debug.WriteLine("### ES REQEUST ###"); if (details.RequestBodyInBytes != null) Debug.WriteLine(Encoding.UTF8.GetString(details.RequestBodyInBytes)); Debug.WriteLine("### ES RESPONSE ###"); if (details.ResponseBodyInBytes != null) Debug.WriteLine(Encoding.UTF8.GetString(details.ResponseBodyInBytes)); }).PrettyJson(); elasticClient = new ElasticClient(settings); Nest.ISearchResponse<DataModel.Position> searchResponse = new Nest.SearchResponse<DataModel.Position>(); int[] units = Array.ConvertAll(unitFilter.Split(','), c => int.Parse(c)); //Query using Search Descriptor var sd