Skip to content

Instantly share code, notes, and snippets.

@dantam
dantam / example.sh
Created April 2, 2012 22:32
ElasticSearch difficulties with edge ngram and synonym analyzer
set -x
curl -XDELETE 'http://localhost:9200/twitter'
curl -XPUT 'http://localhost:9200/twitter' -d '{
"index" : {
"analysis" : {
"analyzer" : {
"test_analyzer" : {
"type" : "custom",
#!/usr/bin/env python
import sys
from collections import defaultdict
def setup_mapping():
'''mapping character to number of enclosed circles in the character'''
m = defaultdict(int)