elasticsearch - How to exclude inherited object properties from mappings -


i'm trying setup mapping object looks this:

class testobject {     public long testid { get; set; }      [elasticproperty(type = fieldtype.object)]     public dictionary<long, list<datetime>> items { get; set; } } 

i use following mapping code (where client ielasticclient):

this.client.map<testobject>(m => m.mapfromattributes()); 

i following mapping result:

{ "mappings": {   "testobject": {     "properties": {       "items": {         "properties": {           "comparer": {             "type": "object"           },           "count": {             "type": "integer"           },           "item": {             "type": "date",             "format": "dateoptionaltime"           },           "keys": {             "properties": {               "count": {                 "type": "integer"               }             }           },           "values": {             "properties": {               "count": {                 "type": "integer"               }             }           }         }       },       "testid": {         "type": "long"       }     }   } } 

this becomes problem when want search this:

{     "query_string": {         "query": "[2015-06-03t00:00:00.000 2015-06-05t23:59:59.999]",             "fields": [                 "items.*"                 ]               }             } 

this causes exceptions, guess because of fields in items object not of same type. proper mapping searches of type?

i able fix using following mapping:

this.client.map<testobject>(m => m.mapfromattributes())     .properties(p => p         .object<dictionary<long, list<datetime>>>(o => o.name("items"))); 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -