Skip to content

Instantly share code, notes, and snippets.

Clinton Gormley clintongormley

View GitHub Profile
@clintongormley
clintongormley / unique_words.js
Created Apr 3, 2017
Only return docs where all of the words in the docs are in the query
View unique_words.js
PUT t
{
"settings": {
"analysis": {
"analyzer": {
"unique_terms": {
"tokenizer": "standard",
"filter": [
"lowercase",
"unique"
View Request.json
PUT t
{
"mappings": {
"t": {
"properties": {
"bool": {
"type": "boolean"
}
}
}
View gist:831fc4f71910b4630073
elasticsearch-2.0.0-rc1> ./bin/plugin install -v delete-by-query
-> Installing delete-by-query...
Trying https://download.elastic.co/elasticsearch/release/org/elasticsearch/plugin/delete-by-query/2.0.0-rc1/delete-by-query-2.0.0-rc1.zip ...
Downloading ..DONE
Verifying https://download.elastic.co/elasticsearch/release/org/elasticsearch/plugin/delete-by-query/2.0.0-rc1/delete-by-query-2.0.0-rc1.zip checksums if available ...
Downloading .DONE
PluginInfo{name='delete-by-query', description='The Delete By Query plugin allows to delete documents in Elasticsearch with a single query.', site=false, jvm=true, classname=org.elasticsearch.plugin.deletebyquery.DeleteByQueryPlugin, isolated=true, version='2.0.0-rc1'}
Installed delete-by-query into /Users/clinton/workspace/servers/elasticsearch-2.0.0-rc1/plugins/delete-by-query
View gist:72fca0948755dac3ce5d
I ran the following on master:
DELETE *
PUT t/t/1
{
"foo": [[1]]
}
PUT t/t/1
@clintongormley
clintongormley / gist:f52fa305870fb6a7a593
Created Aug 6, 2015
I ran the following on master:
View gist:f52fa305870fb6a7a593
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x0000000109334122, pid=7182, tid=28931
#
# JRE version: 7.0_21-b12
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.21-b01 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# V [libjvm.dylib+0x334122]
#
View test.pl
use Search::Elasticsearch;
my $e = Search::Elasticsearch->new( trace_to => 'Stderr' );
my %blogpost = (
title => "My first blogpost",
author => 'Clint',
content => 'blah blah blah'
);
@clintongormley
clintongormley / demo.json
Created May 23, 2014
Only match if it matches all the tokens in a field
View demo.json
DELETE /_all
PUT /t
{
"mappings": {
"test": {
"properties": {
"text": {
View example.json
curl -XGET "http://localhost:9200/_search" -d'
{
"query": {
"bool": {
"should": [
{
"match": {
"parent.text": "query string"
}
},
View all_segs_few_docs.json
{
"status": "COMPLETE",
"errors": [],
"competitors": {
"bool": {
"summary": {
"nodes": [
"Spike"
],
"total_iterations": 5,
View emoticons.pl
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
my @order;
my %char_filters;
use Regexp::Trie;
You can’t perform that action at this time.