Skip to content

Instantly share code, notes, and snippets.

@mcantelon
Created May 26, 2013 04:36
Show Gist options
  • Save mcantelon/5651722 to your computer and use it in GitHub Desktop.
Save mcantelon/5651722 to your computer and use it in GitHub Desktop.
ElasticSearch date detection disabling
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