Skip to content

Instantly share code, notes, and snippets.

curl -XGET 'http://localhost:9200/keywords/pt_BR/_search?pretty=true' -d '
{
"query": {
"fuzzy": {
"keyword": {
"value": "hoteis sao paulo",
"prefix_length": 0,
"min_similarity": 0.6
}
}
@alfetopito
alfetopito / gist:3170803
Created July 24, 2012 15:48
ElasticSearch Mappings and Analyzer
# Mappings
curl -XGET 'http://localhost:9200/tokens,keywords/_mapping?pretty=true'
{
"keywords" : {
"pt_BR" : {
"properties" : {
"keyword" : {
"type" : "string",
"boost" : 10.0,
"analyzer" : "keyword",
@alfetopito
alfetopito / gist:2286575
Created April 2, 2012 19:30
Celery eventlet tryout 2
import eventlet
import tasks
json = eventlet.import_patched('json')
from eventlet.queue import LightQueue
from time import sleep
eventlet.monkey_patch()
def processTask(cfgFile):
print ("Processing stuff here")
@alfetopito
alfetopito / gist:2225687
Created March 28, 2012 12:07
Celery eventlet tryout
import eventlet
import tasks
#from json import dump, load
from django.conf import settings
from glob import glob
json = eventlet.import_patched('json')
eventlet.monkey_patch()
poll = eventlet.GreenPool()