Skip to content

Instantly share code, notes, and snippets.

View mauricioalarcon's full-sized avatar

Mauricio A mauricioalarcon

  • San Francisco, CA
View GitHub Profile
Fri Jun 30 13:54:48 UTC 2017
@mauricioalarcon
mauricioalarcon / fr.sh
Created November 22, 2012 17:02 — forked from dadoonet/fr.sh
French analyzer for ES
#!/bin/bash
ES='http://localhost:9200'
ESIDX='test3'
ESTYPE='test'
curl -XDELETE $ES/$ESIDX
curl -XPUT $ES/$ESIDX/ -d '{
"settings" : {
@mauricioalarcon
mauricioalarcon / gist:4132033
Created November 22, 2012 16:36
simple text search
# Inserting a pckg
curl -X POST localhost:9200/pckgs/pckg/1 -d '{
"pckg" : {
"title" : "Rio de Janeiro",
"shuttleService": "NOTINC",
"published" : "true",
}
}'
@mauricioalarcon
mauricioalarcon / gist:3498562
Created August 28, 2012 14:37
working version of multi_field facet
# Delete the index
curl -XDELETE localhost:9200/facettests/facettest/
# create it
curl -XPUT localhost:9200/facettests/
# set mapping (multi field for facets)
# NOTE THAT THIS HAS KEYWORD ANALYZER OVER NAME, and not nameFacet
# this DOES work
@mauricioalarcon
mauricioalarcon / gist:3498390
Created August 28, 2012 14:14
facet test over employmentHistory
# Delete the index
curl -XDELETE localhost:9200/facettests/
# create it
curl -XPUT localhost:9200/facettests/
# set mapping (multi field for facets)
curl -XPUT localhost:9200/facettests/facettest/_mapping -d '{
"facettest" : {
"properties" : {
@mauricioalarcon
mauricioalarcon / html_strip test
Created October 27, 2011 13:34
ES html_strip test analuzer
# Delete previous just in case
curl -XDELETE localhost:9200/facettests/facettest/
# Set the mapping for out facet
curl -XPUT localhost:9200/facettests/facettest/_mapping -d '{
"facettest" : {
"properties" : {
"employmentHistory" : {
"properties" : {
"name" : {
@mauricioalarcon
mauricioalarcon / geo_distance_test
Created June 23, 2011 20:25
geo_distance test for ES
# Inserting a pin
curl -X POST "http://localhost:9200/pins/pin/1" -d '{
"pin" : {
"location" : {
"lat" : 40.12,
"lon" : -71.34
},
"tag" : ["food", "family"],
"text" : "my favorite family restaurant"
}