当前位置: 首页>>代码示例>>C#>>正文


C# ElasticsearchCrudJsonWriter类代码示例

本文整理汇总了C#中ElasticsearchCrudJsonWriter的典型用法代码示例。如果您正苦于以下问题:C# ElasticsearchCrudJsonWriter类的具体用法?C# ElasticsearchCrudJsonWriter怎么用?C# ElasticsearchCrudJsonWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ElasticsearchCrudJsonWriter类属于命名空间,在下文中一共展示了ElasticsearchCrudJsonWriter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WriteJson

		public void WriteJson(ElasticsearchCrudJsonWriter elasticsearchCrudJsonWriter)
		{
			elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName("type");
			elasticsearchCrudJsonWriter.JsonWriter.WriteStartObject();
			JsonHelper.WriteValue("value", _type, elasticsearchCrudJsonWriter);
			elasticsearchCrudJsonWriter.JsonWriter.WriteEndObject();
		}
开发者ID:cuulee,项目名称:ElasticsearchCRUD,代码行数:7,代码来源:TypeFilter.cs

示例2: WriteJson

        public void WriteJson(ElasticsearchCrudJsonWriter elasticsearchCrudJsonWriter)
        {
            elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName("indices");
            elasticsearchCrudJsonWriter.JsonWriter.WriteStartObject();

            JsonHelper.WriteListValue("indices", _indices, elasticsearchCrudJsonWriter);

            elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName("filter");
            elasticsearchCrudJsonWriter.JsonWriter.WriteStartObject();
            _filter.WriteJson(elasticsearchCrudJsonWriter);
            elasticsearchCrudJsonWriter.JsonWriter.WriteEndObject();

            if (_noMatchFilterSet)
            {
                elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName("no_match_filter");
                elasticsearchCrudJsonWriter.JsonWriter.WriteStartObject();
                _noMatchFilter.WriteJson(elasticsearchCrudJsonWriter);
                elasticsearchCrudJsonWriter.JsonWriter.WriteEndObject();
            }
            else if (!_noMatchFilterSet && _noMatchFilterNoneSet)
            {
                JsonHelper.WriteValue("no_match_filter", "none", elasticsearchCrudJsonWriter);
            }

            elasticsearchCrudJsonWriter.JsonWriter.WriteEndObject();
        }
开发者ID:jnus,项目名称:ElasticsearchCRUD,代码行数:26,代码来源:IndicesFilter.cs

示例3: WriteJson

        public void WriteJson(ElasticsearchCrudJsonWriter elasticsearchCrudJsonWriter)
        {
            elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName("script");
            elasticsearchCrudJsonWriter.JsonWriter.WriteStartObject();

            elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName("script");
            elasticsearchCrudJsonWriter.JsonWriter.WriteRawValue("\"" + _script + "\"");
            if (_paramsSet)
            {
                elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName("params");
                elasticsearchCrudJsonWriter.JsonWriter.WriteStartObject();

                foreach (var item in _params)
                {
                    elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName(item.ParameterName);
                    elasticsearchCrudJsonWriter.JsonWriter.WriteValue(item.ParameterValue);
                }
                elasticsearchCrudJsonWriter.JsonWriter.WriteEndObject();
            }

            JsonHelper.WriteValue("lang", "groovy", elasticsearchCrudJsonWriter);

            JsonHelper.WriteValue("_cache", _cache, elasticsearchCrudJsonWriter, _cacheSet);

            elasticsearchCrudJsonWriter.JsonWriter.WriteEndObject();
        }
开发者ID:jnus,项目名称:ElasticsearchCRUD,代码行数:26,代码来源:ScriptFilter.cs

示例4: WriteJson

		public void WriteJson(ElasticsearchCrudJsonWriter elasticsearchCrudJsonWriter)
		{
			JsonHelper.WriteValue("_index", _index, elasticsearchCrudJsonWriter, _indexSet);
			JsonHelper.WriteValue("_type", _type, elasticsearchCrudJsonWriter, _typeSet);
			JsonHelper.WriteValue("_id", _id, elasticsearchCrudJsonWriter, _idSet);
			JsonHelper.WriteValue("_routing", _routing, elasticsearchCrudJsonWriter, _routingSet);
		}
开发者ID:cuulee,项目名称:ElasticsearchCRUD,代码行数:7,代码来源:Document.cs

示例5: WriteJson

		public void WriteJson(ElasticsearchCrudJsonWriter elasticsearchCrudJsonWriter)
		{
			elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName("order");
			elasticsearchCrudJsonWriter.JsonWriter.WriteStartObject();
			JsonHelper.WriteValue(_field, _order.ToString(), elasticsearchCrudJsonWriter);
			elasticsearchCrudJsonWriter.JsonWriter.WriteEndObject();
		}
开发者ID:cuulee,项目名称:ElasticsearchCRUD,代码行数:7,代码来源:OrderAgg.cs

示例6: WriteJson

        public void WriteJson(ElasticsearchCrudJsonWriter elasticsearchCrudJsonWriter)
        {
            elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName("sort");
            elasticsearchCrudJsonWriter.JsonWriter.WriteStartObject();
            elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName("_script");
            elasticsearchCrudJsonWriter.JsonWriter.WriteStartObject();

            elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName("script");
            elasticsearchCrudJsonWriter.JsonWriter.WriteRawValue("\"" + _script + "\"");
            JsonHelper.WriteValue("order", Order.ToString(), elasticsearchCrudJsonWriter);
            JsonHelper.WriteValue("type", _scriptType, elasticsearchCrudJsonWriter, _scriptTypeSet);
            if (_paramsSet)
            {
                elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName("params");
                elasticsearchCrudJsonWriter.JsonWriter.WriteStartObject();

                foreach (var item in _params)
                {
                    elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName(item.ParameterName);
                    elasticsearchCrudJsonWriter.JsonWriter.WriteValue(item.ParameterValue);
                }
                elasticsearchCrudJsonWriter.JsonWriter.WriteEndObject();
            }

            elasticsearchCrudJsonWriter.JsonWriter.WriteEndObject();
            elasticsearchCrudJsonWriter.JsonWriter.WriteEndObject();
        }
开发者ID:jnus,项目名称:ElasticsearchCRUD,代码行数:27,代码来源:SortScript.cs

示例7: WriteJson

        public void WriteJson(ElasticsearchCrudJsonWriter elasticsearchCrudJsonWriter)
        {
            elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName("span_not");
            elasticsearchCrudJsonWriter.JsonWriter.WriteStartObject();

            elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName("include");
            elasticsearchCrudJsonWriter.JsonWriter.WriteStartObject();
            _include.WriteJson(elasticsearchCrudJsonWriter);
            elasticsearchCrudJsonWriter.JsonWriter.WriteEndObject();

            elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName("exclude");
            elasticsearchCrudJsonWriter.JsonWriter.WriteStartObject();
            _exclude.WriteJson(elasticsearchCrudJsonWriter);
            elasticsearchCrudJsonWriter.JsonWriter.WriteEndObject();

            if (_distSet)
            {
                JsonHelper.WriteValue("dist", _dist, elasticsearchCrudJsonWriter, _distSet);
            }
            else
            {
                JsonHelper.WriteValue("pre", _pre, elasticsearchCrudJsonWriter, _preSet);
                JsonHelper.WriteValue("post", _post, elasticsearchCrudJsonWriter, _postSet);
            }

            elasticsearchCrudJsonWriter.JsonWriter.WriteEndObject();
        }
开发者ID:jnus,项目名称:ElasticsearchCRUD,代码行数:27,代码来源:SpanNotQuery.cs

示例8: SerializeAnalyzerWithAsciifoldingFilter

        public void SerializeAnalyzerWithAsciifoldingFilter()
        {
            const string targetJson =
                "\"analysis\":{\"filter\":{\"my_ascii_folding\":{\"type\":\"asciifolding\",\"preserve_original\":true}},\"analyzer\":{\"default\":{\"type\":\"custom\",\"tokenizer\":\"standard\",\"filter\":[\"standard\",\"my_ascii_folding\"]}}}";

            var analysis = new Analysis
            {
                Analyzer =
                {
                    Analyzers = new List<AnalyzerBase>
                    {
                        new CustomAnalyzer("default")
                        {
                            Tokenizer = DefaultTokenizers.Standard,
                            Filter = new List<string> {"standard", "my_ascii_folding"}
                        }
                    }
                },
                Filters =
                {
                    CustomFilters = new List<AnalysisFilterBase> {new AsciifoldingTokenFilter("my_ascii_folding") {PreserveOriginal = true}}
                }
            };

            var jsonWriter = new ElasticsearchCrudJsonWriter();
            analysis.WriteJson(jsonWriter);
            var result = jsonWriter.GetJsonString();
            Console.WriteLine(result);
            Assert.AreEqual(targetJson, result);
        }
开发者ID:jnus,项目名称:ElasticsearchCRUD,代码行数:30,代码来源:AnalysisTests.cs

示例9: WriteJson

		public void WriteJson(ElasticsearchCrudJsonWriter elasticsearchCrudJsonWriter)
		{
			elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName("exists");
			elasticsearchCrudJsonWriter.JsonWriter.WriteStartObject();
			JsonHelper.WriteValue("field", _field, elasticsearchCrudJsonWriter);
			elasticsearchCrudJsonWriter.JsonWriter.WriteEndObject();
		}
开发者ID:cuulee,项目名称:ElasticsearchCRUD,代码行数:7,代码来源:ExistsFilter.cs

示例10: WriteJson

        public void WriteJson(ElasticsearchCrudJsonWriter elasticsearchCrudJsonWriter)
        {
            elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName("constant_score");
            elasticsearchCrudJsonWriter.JsonWriter.WriteStartObject();

            if (_querySet)
            {
                elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName("query");
                elasticsearchCrudJsonWriter.JsonWriter.WriteStartObject();
                _query.WriteJson(elasticsearchCrudJsonWriter);
                elasticsearchCrudJsonWriter.JsonWriter.WriteEndObject();
            }

            if (_filterSet)
            {
                elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName("filter");
                elasticsearchCrudJsonWriter.JsonWriter.WriteStartObject();
                _filter.WriteJson(elasticsearchCrudJsonWriter);
                elasticsearchCrudJsonWriter.JsonWriter.WriteEndObject();
            }

            JsonHelper.WriteValue("boost", _boost, elasticsearchCrudJsonWriter, _boostSet);

            elasticsearchCrudJsonWriter.JsonWriter.WriteEndObject();
        }
开发者ID:jnus,项目名称:ElasticsearchCRUD,代码行数:25,代码来源:ConstantScoreQuery.cs

示例11: WriteJson

        public void WriteJson(ElasticsearchCrudJsonWriter elasticsearchCrudJsonWriter)
        {
            elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName(_name);
            elasticsearchCrudJsonWriter.JsonWriter.WriteStartObject();

            JsonHelper.WriteListValue("types", _indexTypes, elasticsearchCrudJsonWriter, _indexTypesSet);

            elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName("source");
            elasticsearchCrudJsonWriter.JsonWriter.WriteStartObject();

            if (_querySet)
            {
                _query.WriteJson(elasticsearchCrudJsonWriter);
            }

            if (_aggsSet)
            {
                elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName("aggs");
                elasticsearchCrudJsonWriter.JsonWriter.WriteStartObject();
                foreach (var item in _aggs)
                {
                    item.WriteJson(elasticsearchCrudJsonWriter);
                }

                elasticsearchCrudJsonWriter.JsonWriter.WriteEndObject();
            }

            elasticsearchCrudJsonWriter.JsonWriter.WriteEndObject();
            elasticsearchCrudJsonWriter.JsonWriter.WriteEndObject();
        }
开发者ID:jnus,项目名称:ElasticsearchCRUD,代码行数:30,代码来源:IndexWarmer.cs

示例12: WriteValues

        private void WriteValues(ElasticsearchCrudJsonWriter elasticsearchCrudJsonWriter)
        {
            WriteCommonValues(elasticsearchCrudJsonWriter);

            JsonHelper.WriteValue("lowercase", _lowercase, elasticsearchCrudJsonWriter, _lowercaseSet);
            JsonHelper.WriteValue("pattern", _pattern, elasticsearchCrudJsonWriter, _patternSet);
            JsonHelper.WriteValue("flags", _flags, elasticsearchCrudJsonWriter, _flagsSet);
        }
开发者ID:jnus,项目名称:ElasticsearchCRUD,代码行数:8,代码来源:PatternAnalyzer.cs

示例13: WriteSpecificJson

 private void WriteSpecificJson(ElasticsearchCrudJsonWriter elasticsearchCrudJsonWriter)
 {
     if (AnalyzerSet)
     {
         JsonHelper.WriteListValue("filter", _filter, elasticsearchCrudJsonWriter, _filterSet);
         JsonHelper.WriteListValue("char_filter", _charFilter, elasticsearchCrudJsonWriter, _charFilterSet);
     }
 }
开发者ID:jnus,项目名称:ElasticsearchCRUD,代码行数:8,代码来源:CustomAnalyzer.cs

示例14: WriteSpecificJson

 private void WriteSpecificJson(ElasticsearchCrudJsonWriter elasticsearchCrudJsonWriter)
 {
     if (AnalyzerSet)
     {
         WriteCommonValues(elasticsearchCrudJsonWriter);
         JsonHelper.WriteValue("language", _language.ToString(), elasticsearchCrudJsonWriter, _languageSet);
     }
 }
开发者ID:jnus,项目名称:ElasticsearchCRUD,代码行数:8,代码来源:SnowballAnalyzer.cs

示例15: WriteJson

		public override void WriteJson(ElasticsearchCrudJsonWriter elasticsearchCrudJsonWriter)
		{
			Similarities.WriteJson(elasticsearchCrudJsonWriter);
			Analysis.WriteJson(elasticsearchCrudJsonWriter);
			JsonHelper.WriteValue("number_of_shards", _numberOfShards, elasticsearchCrudJsonWriter, _numberOfShardsSet);
			base.WriteJson(elasticsearchCrudJsonWriter);
			
		}
开发者ID:cuulee,项目名称:ElasticsearchCRUD,代码行数:8,代码来源:IndexSettings.cs


注:本文中的ElasticsearchCrudJsonWriter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。