Skip to content

Instantly share code, notes, and snippets.

@huyphan
huyphan / gist:9888959
Created March 31, 2014 09:51
Weird behavior of Elasticsearch 1.0.1
# Delete the index if exists
$ curl -XDELETE "http://localhost:9200/sample"
{"acknowledged":true}
# Create "sample" index, with standard analyzer using comma character for tokenizing
$ curl -XPUT "http://localhost:9200/sample" -d '
{
"settings" : {
"index" : {
"analysis" : {
@huyphan
huyphan / gist:6361962
Created August 28, 2013 03:50
A modified version of this script https://pika.readthedocs.org/en/latest/examples/asynchronous_publisher_example.html to test how pika deals with closed socket
# -*- coding: utf-8 -*-
import logging
import pika
import json
import time
LOG_FORMAT = ('%(levelname) -10s %(asctime)s %(name) -30s %(funcName) '
'-35s %(lineno) -5d: %(message)s')
LOGGER = logging.getLogger(__name__)