Пример #1
0
        public void RepresentUnknowImageMappingPlugin()
        {
            var imagePluginMapping = new ImagePluginType()
            {
                Name    = "my_img",
                Feature = new Dictionary <string, object>
                {
                    { "CEDD", new { hash = "BIT_SAMPLING" } },
                    { "JCD", new { hash = new [] { "BIT_SAMPLING", "LSH" } } }
                },
                MetaData = new Dictionary <string, object>
                {
                    { "jpeg.image_width", new {
                          type  = "string",
                          store = "yes"
                      } },
                    { "jpeg.image_height", new {
                          type  = "string",
                          store = "yes"
                      } }
                }
            };

            var result = this._client.Map <ElasticsearchProject>(m => m
                                                                 .Properties(p => p
                                                                             .Custom(imagePluginMapping)
                                                                             )
                                                                 );

            this.JsonEquals(result.ConnectionStatus.Request, MethodInfo.GetCurrentMethod());
        }
		public void RepresentUnknowImageMappingPlugin()
		{
			var imagePluginMapping = new ImagePluginType()
			{
				Name = "my_img",
				Feature = new Dictionary<string, object>
				{
					{ "CEDD", new { hash = "BIT_SAMPLING"} },
					{ "JCD", new { hash = new [] {"BIT_SAMPLING", "LSH"}} }
				},
				MetaData = new Dictionary<string, object>
				{
					
					{	"jpeg.image_width", new {
							type = "string",
							store = "yes"
						}
					},
					{	"jpeg.image_height", new {
							type= "string",
							store= "yes"
						}
					}
				}
			};

			var result = this._client.Map<ElasticsearchProject>(m => m
				.Properties(p=>p
					.Custom(imagePluginMapping)
				)
			);
			this.JsonEquals(result.ConnectionStatus.Request, MethodInfo.GetCurrentMethod()); 
		}