Skip to content

Instantly share code, notes, and snippets.

View clintongormley's full-sized avatar

Clinton Gormley clintongormley

  • Barcelona, Spain
View GitHub Profile
@clintongormley
clintongormley / unique_words.js
Created April 3, 2017 16:26
Only return docs where all of the words in the docs are in the query
PUT t
{
"settings": {
"analysis": {
"analyzer": {
"unique_terms": {
"tokenizer": "standard",
"filter": [
"lowercase",
"unique"
PUT t
{
"mappings": {
"t": {
"properties": {
"bool": {
"type": "boolean"
}
}
}
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
@clintongormley
clintongormley / gist:72fca0948755dac3ce5d
Last active August 29, 2015 14:26
SIGSEGV on master
I ran the following on master:
DELETE *
PUT t/t/1
{
"foo": [[1]]
}
PUT t/t/1
@clintongormley
clintongormley / gist:f52fa305870fb6a7a593
Created August 6, 2015 12:05
I ran the following on master:
#
# 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]
#
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 10:04
Only match if it matches all the tokens in a field
DELETE /_all
PUT /t
{
"mappings": {
"test": {
"properties": {
"text": {
curl -XGET "http://localhost:9200/_search" -d'
{
"query": {
"bool": {
"should": [
{
"match": {
"parent.text": "query string"
}
},
{
"status": "COMPLETE",
"errors": [],
"competitors": {
"bool": {
"summary": {
"nodes": [
"Spike"
],
"total_iterations": 5,
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
my @order;
my %char_filters;
use Regexp::Trie;