private void CreateCustomMappings(Type type) { string json = Serialization.Serialize(MappingPatterns.GetCustomIndexMapping(Language.GetLanguageAnalyzer(_language))); byte[] data = Encoding.UTF8.GetBytes(json); var uri = _indexing.GetUri(_name, "_mapping", type.GetTypeName()); Logger.Information($"Creating custom mappings. Language: {_language}"); Logger.Information($"PUT: {uri}"); Logger.Information(JToken.Parse(json).ToString(Formatting.Indented)); HttpClientHelper.Put(uri, data); }
private void CreateCustomMappings(Type type) { string json = Serialization.Serialize(MappingPatterns.GetCustomIndexMapping(Language.GetLanguageAnalyzer(_language))); byte[] data = Encoding.UTF8.GetBytes(json); var extraParams = _serverInfo.Version >= Constants.IncludeTypeNameAddedVersion ? "include_type_name=true" : null; var uri = _indexing.GetUri(_name, "_mapping", type.GetTypeName(), extraParams); _logger.Information($"Creating custom mappings. Language: {_language}"); _logger.Information($"PUT: {uri}"); _logger.Information(JToken.Parse(json).ToString(Formatting.Indented)); _httpClientHelper.Put(uri, data); }