Skip to content

Instantly share code, notes, and snippets.

public abstract class MergeScheduler {
void merge(IndexWriter writer, MergeTrigger trigger, boolean newMergesFound){
if (acquirePermit()) {
try {
doMerg(writer, trigger, newMergesFound);
} finally {
releasePermit();
}
}
}
@s1monw
s1monw / github_issues.py
Created April 25, 2014 21:11
github_issues.py
# Licensed to Elasticsearch under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@s1monw
s1monw / fixed_mapping
Created April 25, 2014 18:51
mixed_tv_mapping
{
"mapname":{
"_all":{
"enabled":true
},
"properties":{
"importantInfo":{
"properties":{
"uselessField1":{
"type":"boolean",
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@s1monw
s1monw / gist:9970568
Created April 4, 2014 08:36
TestReuseDirectory.java
package org.apache.lucene.index;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
diff --git a/src/main/java/org/elasticsearch/action/terms/ShardTermsByQueryRequest.java b/src/main/java/org/elasticsearch/action/terms/ShardTermsByQueryRequest.java
index 3a16c84..7f31877 100644
--- a/src/main/java/org/elasticsearch/action/terms/ShardTermsByQueryRequest.java
+++ b/src/main/java/org/elasticsearch/action/terms/ShardTermsByQueryRequest.java
@@ -150,7 +150,7 @@ class ShardTermsByQueryRequest extends BroadcastShardOperationRequest {
} else {
out.writeVInt(0);
}
- out.writeString(field);
+ out.writeString(field); // THIS IS NULL!!
import com.google.common.util.concurrent.Futures;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.search.SearchType;
import org.elasticsearch.client.Client;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.test.AbstractIntegrationTest;
curl -XDELETE "http://localhost:9200/test?pretty"
curl -XPOST "http://localhost:9200/test?pretty" -d '{
"settings": {
"index": {
"number_of_shards" : 1,
"number_of_replicas" : 1
}
},
"mappings" : {
"participants" : {
@s1monw
s1monw / gist:6041808
Created July 19, 2013 19:35
output example
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.017 sec - in org.elasticsearch.test.unit.cluster.routing.allocation.SingleShardNoReplicasRoutingTests
testSingleIndexStartedShard(org.elasticsearch.test.unit.cluster.routing.allocation.SingleShardNoReplicasRoutingTests) Time elapsed: 0.001 sec
testSingleIndexShardFailed(org.elasticsearch.test.unit.cluster.routing.allocation.SingleShardNoReplicasRoutingTests) Time elapsed: 0.001 sec
testMultiIndexEvenDistribution(org.elasticsearch.test.unit.cluster.routing.allocation.SingleShardNoReplicasRoutingTests) Time elapsed: 0.013 sec
testMultiIndexUnevenNodes(org.elasticsearch.test.unit.cluster.routing.allocation.SingleShardNoReplicasRoutingTests) Time elapsed: 0.002 sec
Running org.elasticsearch.test.integration.nodesinfo.SimpleNodesInfoTests
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.312 sec - in org.elasticsearch.test.integration.nodesinfo.SimpleNodesInfoTests
testNodeInfoPlugin(org.elasticsearch.test.integration.nodesinfo.S