[ POPULAR STORIES ]

CATCH UP THE POPULAR STORIES

Elasticsearch – Use Script Filter/Conditon in Aggregation/Sub-Aggreagtion

Example 1 – REST: GET /INDEX/TYPE/_search { "size": 0, "aggs": { "FILTER_NAME": { "filter": { "script": { "script": "doc['field1'].value < doc['field2'].value" } } } } } Example 1 – Java API: SearchRequestBuilder searchRequestBuilder = esClient .prepareSearch("INDEX) .setTypes("TYPE") .setSize(0) .addAggregation( AggregationBuilders.filter("FILTER_NAME").filter(FilterBuilders.scriptFilter("doc['filed1'].value > doc['field2'].value"))); SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); Map<String, Aggregation> aggMap = searchResponse.getAggregations().asMap(); InternalFilter filter = (InternalFilter)… Read More »

Read more
Alternative text

Elasticsearch Java API – Get Type List from given Index

The following is sample Java program to get the list of type for a given index name in an Elasticsearch instance. Sample Program: package com.report.test; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ExecutionException; import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsRequest; import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse; import org.elasticsearch.client.Client; import org.elasticsearch.client.transport.TransportClient; import org.elasticsearch.cluster.metadata.MappingMetaData; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.hppc.cursors.ObjectObjectCursor; import org.elasticsearch.common.settings.ImmutableSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.InetSocketTransportAddress; public class SampleProgram{ public static… Read More »

Read more
Alternative text

Oculus Rift – nxtGen Virtual Reality Headset

              Computers and Laptops are one of the daily used electronic products particularly for entertainment. Movies, Gaming, Music are some of its kind in entertainment. Considering movies and gaming, we get maximum experience with large displays and monitors.  Some people will even use projector for such kind of great experience. Here we have another… Read More »

Read more
Alternative text

Elasticsearch Geo-Shape Slow Indexing Performance – Solved

           We were using Hosted Elasticsearch 1.4.4 to index geo-shape data with the following field mapping. { "geoShapeField": {     "type": "geo_shape",        "tree": "quadtree",        "tree_levels": 26 //Or use precision: "1m",        "distance_error_pct": 0.025 // Optional, 0.025 is default } }      … Read More »

Read more
Alternative text

Magic Cube & evoMouse – An Innovative Virtual Keyboard & Mouse

           Computers are one of the most popular electronic devices for decades. The mobility increased with the development of laptops. Now a days even smartphones too have powerful processor and memory built in it. In Desktops, keyboard and mouse are the standard input devices which are in use for very long time. In… Read More »

Read more
Alternative text

[ LATEST STORIES ]

CATCH UP THE LATEST STORIES

[ SUBSCRIBE TO OUR BLOG ]