简体   繁体   中英

Elasticsearch dynamic or forced mapping errors

I have nested child in the following format:

"product" : {
   "skus" : [{"bestbuy.com" : "bsku123"},
             {"otherretail.com" : "somerandomsku111"},
             {"somesite.com" : "48043s"}]
}

since the source site / sku combination is a free form format, the importer constantly breaks after importing N number of records with the error message saying something similar to this:

nested: ElasticSearchParseException[failed to parse date field [48043s], 
tried both date format [dateOptionalTime], and timestamp number]; nested:
IllegalArgumentException[Invalid format: \"48043s\" is malformed at \"s\"]

clearly it happenning because one of the records may have a sku added in the date format which forced that particular vendor to automap it's value to a date format

How do I overwrite this auto-date mapping format for all skus.* named key/value pairs? or is there a better format to store all data that I require - Vendor + Vendor specific SKU?

I tried setting this in the mapping, but it didn't change a thing:

'skus.*' => array( 'index'  => 'not_analyzed',
                   'type'   => 'string' ),

any help would be greatly appreciated.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM