Created
May 26, 2013 04:36
-
-
Save mcantelon/5651722 to your computer and use it in GitHub Desktop.
ElasticSearch date detection disabling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
conn.create_index(index) | |
except: | |
pass | |
conn.put_mapping(doc_type=doc_type, mapping={'widget': {'date_detection': False}}, indices=[index]) | |
docData = { | |
'text': 'hey now', | |
'date': '2000-03-01' | |
} | |
conn.index(docData, index, doc_type) | |
docData = { | |
'text': 'hey now2', | |
'date': '2000-03-__' | |
} | |
conn.index(docData, index, doc_type) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment