[ POPULAR STORIES ]

CATCH UP THE POPULAR STORIES

Execute Raw Elasticsearch Query using Transport Client – Java API

           The following sample program details on how to execute raw Elasticsearch query using Transport Client (Java API).  Maven Dependencies: <dependencies> <dependency> <groupId>org.elasticsearch</groupId> <artifactId>elasticsearch</artifactId> <version>1.5.0</version> </dependency> <dependency> <groupId>org.json</groupId> <artifactId>json</artifactId> <version>20140107</version> </dependency> </dependencies>            Add the above MAVAN dependencies to the POM file or add the JARs specified in… Read More »

Read more
Alternative text

Open Google Maps in New Browser Tab with Location (Latitude & Longitude) Tagged/Marked

     This is one of the main requirement in most of the location based applications and as well as in static page websites where one needs to open Google Maps in new tab (using HTML link) with the given location tagged. The below URL can be used to acheive the same and the URL… Read More »

Read more
Alternative text

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

Location – Latitude/Longitude (Lat/Lon) to Degrees Minutes Seconds (DMS) Conversion – JavaScript

Sample JavaScript Program: function truncate(n) { return n > 0 ? Math.floor(n) : Math.ceil(n); } let getDMS = function (dd, longOrLat) { let hemisphere = /^[WE]|(?:lon)/i.test(longOrLat) ? dd < 0 ? "W" : "E" : dd < 0 ? "S" : "N"; const absDD = Math.abs(dd); const degrees = truncate(absDD); const minutes = truncate((absDD -… Read More »

Read more
Alternative text

Social Mobile Apps for Indian General Election 2014

      The internet was once a craze among people. Now it has become very much common. With the internet spread all over the world, the idea of social networking in internet came in picture. Social Networking created a great platform for every one including small-scale to large-scale industries. People were able to build… Read More »

Read more
Alternative text

[ LATEST STORIES ]

CATCH UP THE LATEST STORIES

[ SUBSCRIBE TO OUR BLOG ]