Skip to content

Instantly share code, notes, and snippets.

View martijnvg's full-sized avatar

Martijn van Groningen martijnvg

  • Elastic
  • Hoofddorp
View GitHub Profile
@martijnvg
martijnvg / gist:3424418
Created August 22, 2012 11:00
query_parse_error
curl -XPUT 'http://localhost:9200/keeks/keek/1' -d '{"sr_loc": "1", "loc": "US", "c_at": "20120820095233"}'
curl -XGET 'http://localhost:9200/keeks/_search?pretty=true' -d '{"query":{"filtered" : {"query" : {"match_all":{}},"filter":{"bool":{"must":[{"term":{"sr_loc":"1"}},{"term":{"loc":"US" }},{"range":{"c_at":{"to":"20120820095233","include_lower":false}}}]}}}}, "sort":[{"c_at":{"order":"desc"}}], "size":"20"}'
curl -XDELETE "http://localhost:9200/test_index"
curl -XPUT "http://localhost:9200/test_index/"
curl -XPUT "http://localhost:9200/test_index/test_index/_mapping" -d '{
"test_index" : {
"_source" : {"enabled" : true},
"properties": {
"A": { "include_in_all": true, "type": "string"},
"B": { "include_in_all": false, "type": "string"}
}
java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:640)
at java.util.concurrent.ThreadPoolExecutor.addIfUnderMaximumPoolSize(ThreadPoolExecutor.java:727)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:657)
at org.elasticsearch.transport.netty.MessageChannelHandler.handleRequest(MessageChannelHandler.java:212)
at org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:111)
at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:75)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:565)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:793)
Martijns-MacBook-Air:elastic2 mvg$ fgrep "which is also master but with" ../elastic6/*
../elastic6/nprapi.log.2012-10-29:[2012-10-29 00:41:49,687][WARN ][discovery.zen ] [elastic6] received cluster state from [[elastic2][QCBOnwmHQGu16I26e0i7Rg][inet[/172.31.2.62:9300]]{rack_id=rack1}] which is also master but with an older cluster_state, telling [[elastic2][QCBOnwmHQGu16I26e0i7Rg][inet[/172.31.2.62:9300]]{rack_id=rack1}] to rejoin the cluster
../elastic6/nprapi.log.2012-10-29:[2012-10-29 00:42:19,701][WARN ][discovery.zen ] [elastic6] received cluster state from [[elastic2][QCBOnwmHQGu16I26e0i7Rg][inet[/172.31.2.62:9300]]{rack_id=rack1}] which is also master but with an older cluster_state, telling [[elastic2][QCBOnwmHQGu16I26e0i7Rg][inet[/172.31.2.62:9300]]{rack_id=rack1}] to rejoin the cluster
../elastic6/nprapi.log.2012-10-29:[2012-10-29 00:42:49,706][WARN ][discovery.zen ] [elastic6] received cluster state from [[elastic2][QCBOnwmHQGu16I26e0i7Rg][inet[/172.31.2.62:9300]]{r
@martijnvg
martijnvg / gist:4091080
Created November 16, 2012 21:28
soft cache - Ran with -Xmx128M
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.RemovalListener;
import com.google.common.cache.RemovalNotification;
/**
*/
public class Testje {
public static void main(String[] args) {
@martijnvg
martijnvg / gist:4203869
Created December 4, 2012 13:30
testing highlighting fragment_size option.
curl -XDELETE 'localhost:9200'
curl -XPUT 'localhost:9200/nyt' -d '{
"settings": {
"analysis": {
"filter": {
"token_ngrams": {
"side": "front",
"max_gram": 20,
"min_gram": 2,
"type": "edgeNGram"
@martijnvg
martijnvg / Testje.java
Created December 5, 2012 11:50
Show all indices.
import org.elasticsearch.action.admin.indices.status.IndicesStatusResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.common.metrics.CounterMetric;
import org.elasticsearch.index.field.data.FieldData;
import org.elasticsearch.index.field.data.ints.SingleValueIntFieldData;
import org.elasticsearch.node.Node;
import org.elasticsearch.node.NodeBuilder;
/**
*/
@martijnvg
martijnvg / 2262.sh
Created December 12, 2012 10:55
Match query with multiple tokens as query with and without boost.
#!/bin/bash
curl -XDELETE 'http://localhost:9200/status_index'
echo ""
curl -XPUT 'http://localhost:9200/status_index/?pretty=1' -d '{
"mappings" : {
"status" : {
"properties" : {
"id" : {
"type" : "integer"
@martijnvg
martijnvg / update-threadpool-settings.sh
Created December 14, 2012 11:44
Example updating thread_pool settings.
curl -XPUT 'localhost:9200/_cluster/settings' -d '{
"transient" : {
"threadpool.management.size" : 5
}
}'
curl -XGET 'localhost:9200/_nodes?thread_pool&format=yaml'
@martijnvg
martijnvg / testcase.sh
Created December 17, 2012 09:38
Simple case demonstrating that mlt fails to work when routing is specified.
curl -XPUT 'localhost:9200/a/a/1?routing=2&refresh' -d '{
"field" : "value"
}'
curl -XGET 'localhost:9200/a/a/1/_mlt?routing=2'