Here's the problem.

I have data with date field that can be either in english or german date
format (or rather week and month naming convention). 

I.e."Mittwoch, 18. Juni 2012" or "Wednesday, 18. June 2012"

I can set up separate mappings for separate fileds for each nation's date.

{
    "website" : {
        "properties" : {
            "date_en" : {
                                "type" : "date", 
                                "format" : "EEE, dd. MMM yyyy", 
                                "locale" : "US"
                        }
        }
    }
}

{
    "website" : {
        "properties" : {
            "date_de" : {
                                "type" : "date", 
                                "format" : "EEE, dd. MMM yyyy", 
                                "locale" : "DE"
                        }
        }
    }
}

And this work properly, untill I will try to put engilsh date into german
date field and backwards.

I do not have option to receive some additional data with date's locale
information.

What I need is the option to recognize each type of date, save it internally
in timestamp (for sorting) and do that in one and the same field (because of
sorting and field naming convention).

Something like this.
{
    "website" : {
        "properties" : {
            "date" : {
                                "type" : "date", 
                                "format" : "EEE, dd. MMM yyyy", 
                                "locale" : "US||DE"
                        }
        }
    }
}

What I want to achive is be able to sort all documents with different
country dates by date. Maybe there can be different approach. I'll gladly
try other solutions.




--
View this message in context: 
http://elasticsearch-users.115913.n3.nabble.com/One-date-field-mapping-for-two-different-locale-tp4059118.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/1404289689171-4059118.post%40n3.nabble.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to