Skip to content

Instantly share code, notes, and snippets.

stratawing

Block or report user

Report or block stratawing

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:2019391
# mappings and analyzer below
curl -XPUT http://localhost:9200/cerberus -d '{
"mappings" : {
"rawcrit" : {
"properties" : {
....snip....
"std_par":{"type" : "string", "index_analyzer":"std_par"}
}
}
View ES Beginner's PHP Script
<?php
$ch = curl_init();
$method = "GET";
$url = "localhost/cerberus/resraw/_search?pretty=true";
$qry = '{
"size" : 10,
"fields" : "usr",
"query" : {
@stratawing
stratawing / XLSX to ES
Created Feb 13, 2012
Command Line Script to bulk load XLSX into ES
View XLSX to ES
unzip -Uo 10k_records.xlsx xl/worksheets/sheet1.xml xl/sharedStrings.xml -d proc
cat proc/xl/sharedStrings.xml \
| sed -e 's/[^[:print:][:blank:][:space:]]/[?]/g' -e 's/|/-delim-/g' \
| mawk 'BEGIN {RS = "</t></si><si><t>|<si><t>|</t></si></sst>|</t></si><si><t xml:space=\"preserve\">"
FS = "999ABCDE"
OFS = "|"}
{ print NR - 2, $1 }' \
| LANG=C sort -f -t "|" -k1 \
| grep -v "<sst xmlns=\|<?xml version" \
You can’t perform that action at this time.