Skip to content

Instantly share code, notes, and snippets.

@bonzanini
Created May 4, 2015 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save bonzanini/642bd3404615df9e0b83 to your computer and use it in GitHub Desktop.
Save bonzanini/642bd3404615df9e0b83 to your computer and use it in GitHub Desktop.
Create sample DB on Elasticsearch to showcase decay function over publication date
curl -XDELETE http://localhost:9200/blog
curl -XPUT http://localhost:9200/blog -d '{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
}
},
"mapping": {
"posts": {
"properties": {
"title": "string",
"published": "date"
}
}
}
}'
curl -XPOST http://localhost:9200/blog/posts -d '{
"title": "My Python code is slow? Tips for profiling",
"published": "2015-01-05"
}'
curl -XPOST http://localhost:9200/blog/posts -d '{
"title": "Searching PubMed with Python",
"published": "2015-01-12"
}'
curl -XPOST http://localhost:9200/blog/posts -d '{
"title": "Sentiment Analysis with Python and scikit-learn",
"published": "2015-01-19"
}'
curl -XPOST http://localhost:9200/blog/posts -d '{
"title": "Stemming, Lemmatisation and POS tagging with Python and NLTK",
"published": "2015-01-26"
}'
curl -XPOST http://localhost:9200/blog/posts -d '{
"title": "How to query Elasticsearch with Python",
"published": "2015-02-02"
}'
curl -XPOST http://localhost:9200/blog/posts -d '{
"title": "PyData London Meetup 2015-02-03",
"published": "2015-02-03"
}'
curl -XPOST http://localhost:9200/blog/posts -d '{
"title": "Phrase Match and Proximity search in Elasticsearch",
"published": "2015-02-09"
}'
curl -XPOST http://localhost:9200/blog/posts -d '{
"title": "Fuzzy String Matching in Python",
"published": "2015-02-25"
}'
curl -XPOST http://localhost:9200/blog/posts -d '{
"title": "Mining Twitter Data with Python (Part 1: Collecting Data)",
"published": "2015-03-02"
}'
curl -XPOST http://localhost:9200/blog/posts -d '{
"title": "Mining Twitter Data with Python (Part 2: Text pre-processing)",
"published": "2015-03-09"
}'
curl -XPOST http://localhost:9200/blog/posts -d '{
"title": "Mining Twitter Data with Python (Part 3: Term Frequencies)",
"published": "2015-03-17"
}'
curl -XPOST http://localhost:9200/blog/posts -d '{
"title": "Mining Twitter Data with Python (Part 4: Rugby and Term Co-occurrencies)",
"published": "2015-03-23"
}'
curl -XPOST http://localhost:9200/blog/posts -d '{
"title": "Mining Twitter Data with Python (Part 5: Data Visualisation Basics)",
"published": "2015-04-01"
}'
curl -XPOST http://localhost:9200/blog/posts -d '{
"title": "Getting started with Neo4j and Python",
"published": "2015-04-06"
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment