Skip to content

Instantly share code, notes, and snippets.

LOG.info("Creating custom score query builder on custom field[" + sortField + "]");
CustomScoreQueryBuilder customScoreQueryBuilder = new CustomScoreQueryBuilder(queryBuilder);
String script = "my";
customScoreQueryBuilder.param("indexFieldName", sortField);
customScoreQueryBuilder.lang("native");
customScoreQueryBuilder.script(script);
return customScoreQueryBuilder;
cluster:
name: CMTDev1
network:
host: 169.49.208.147
public class CustomColumnSorterFactory implements NativeScriptFactory{
private final static Log LOG = LogFactory.getLog(CustomColumnSorterFactory.class);
@Override
public ExecutableScript newScript(Map<String, Object> params) {
LOG.info("******** Creating new ColumnSortScript.");
return new ColumnSortScript(params);
}
{
"took" : 125,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 2,
"failed" : 3,
"failures" : [ {
"index" : "contactindex_2011_05_24_07_02_41",
"shard" : 1,
[2011-05-27 06:56:07,372][INFO ][cluster.service ] [Lila Cheney] new_master [Lila Cheney][O_p4H9a4RGy15DnKQAAIew][inet[/169.49.110.161:9300]], reason: zen-disco-join (elected_as_master)
[2011-05-27 06:56:07,385][TRACE][discovery ] [Lila Cheney] initial state set from discovery
[2011-05-27 06:56:07,385][INFO ][discovery ] [Lila Cheney] CMTQA1/O_p4H9a4RGy15DnKQAAIew
[2011-05-27 06:56:07,487][INFO ][http ] [Lila Cheney] bound_address {inet[/169.49.110.161:9200]}, publish_address {inet[/169.49.110.161:9200]}
[2011-05-27 06:56:07,490][INFO ][node ] [Lila Cheney] {elasticsearch/0.15.2}[25473]: started
[2011-05-27 07:03:02,430][INFO ][cluster.service ] [Lila Cheney] added {[Colossus][YIQOzlTzTwidgSoaOteHXQ][inet[/169.49.110.161:9301]]{client=true, data=false},}, reason: zen-disco-receive(join from node[[Colossus][YIQOzlTzTwidgSoaOteHXQ][inet[/169.49.110.161:9301]]{client=true, data=false}])
[2011-05-27 07:03:02,624][DEBUG][discov
[2011-05-27 06:55:40,003][INFO ][node ] [Lila Cheney] {elasticsearch/0.15.2}[25473]: initializing ...
[2011-05-27 06:55:40,052][INFO ][plugins ] [Lila Cheney] loaded []
[2011-05-27 06:55:47,500][DEBUG][discovery.zen.ping.unicast] [Lila Cheney] using initial hosts [166.15.121.116:9300, 166.15.121.116:9301, 169.49.110.161:9300, 169.49.110.161:9301, 169.49.110.161:9302, 169.49.110.161:9303, 169.49.110.161:9304, 169.49.110.161:9305, 169.49.110.161:9306, 169.49.110.161:9307, 169.49.110.161:9308, 169.49.110.161:9309, 169.49.110.161:9310]
[2011-05-27 06:55:47,522][DEBUG][discovery.zen ] [Lila Cheney] using initial_ping_timeout [3s]
[2011-05-27 06:55:47,528][DEBUG][discovery.zen.fd ] [Lila Cheney] [master] uses ping_interval [1s], ping_timeout [30s], ping_retries [3]
[2011-05-27 06:55:47,541][DEBUG][discovery.zen.fd ] [Lila Cheney] [node ] uses ping_interval [1s], ping_timeout [30s], ping_retries [3]
[2011-05-27 06:55:49,302][INFO ][node
cluster:
name: CMTQA1
network:
host: 169.49.110.161
node:
data: true
path:
Builder fixedSettings = ImmutableSettings.settingsBuilder()
.put("index.number_of_shards", 1)
.put("index.number_of_replicas", 1)
.put("cluster.name", clusterName)
.put("node.client", true )
.put("index.mapper", "dynamic:false")
.put("node.data", false)//script.native.my.lang: native
.put("script.native.my.type","com.cs.cts.crm.elasticsearch.util.CustomColumnSorterFactory")
.put("script.native.my.lang","native");
[2011-06-16 16:03:34,875][INFO ][monitor.jvm ] [Bereet] [gc][ParNew][57741] took [8.2s]/[1.9h], reclaimed [23.8mb], leaving [1.1gb] used, max [2.1gb]
[2011-06-16 16:04:14,750][INFO ][monitor.jvm ] [Bereet] [gc][ParNew][57743] took [7.9s]/[1.9h], reclaimed [29.6mb], leaving [1.1gb] used, max [2.1gb]
[2011-06-16 16:05:20,076][INFO ][monitor.jvm ] [Bereet] [gc][ParNew][57756] took [6.2s]/[1.9h], reclaimed [30.8mb], leaving [1.1gb] used, max [2.1gb]
[2011-06-16 16:07:16,047][INFO ][monitor.jvm ] [Bereet] [gc][ParNew][57765] took [7.4s]/[1.9h], reclaimed [31.3mb], leaving [1.1gb] used, max [2.1gb]
[2011-06-16 16:08:36,186][INFO ][monitor.jvm ] [Bereet] [gc][ParNew][57776] took [6.8s]/[1.9h], reclaimed [31.1mb], leaving [1.1gb] used, max [2.1gb]
[2011-06-16 16:09:29,726][INFO ][monitor.jvm ] [Bereet] [gc][ParNew][57789] took [5.5s]/[1.9h], reclaimed [30.6mb], leaving [1.2gb] used, max [2.1gb]
[2011-06-16 16:09:48,651][INFO ][monitor.jvm
cluster:
name: CMTDev2
node:
data: true
path:
data: /app/securities/rapport/indexfolder/dev2/ES1
boostrap: