[ POPULAR STORIES ]

CATCH UP THE POPULAR STORIES

Elasticsearch Java API – Get Alias List

The following is sample Java program to get the list of aliases in an Elasticsearch instance. Sample Program: package com.report.test; import java.util.ArrayList; import java.util.List; import org.elasticsearch.client.Client; import org.elasticsearch.client.transport.TransportClient; import org.elasticsearch.cluster.metadata.AliasMetaData; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.settings.ImmutableSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.InetSocketTransportAddress; public class SampleProgram{ public static void main(String[] args) { String hostname = "localhost"; String clusterName = "elasticsearch"; Settings… Read More »

Read more
Alternative text

Nvidia Shield – Gaming console and controller

          Nvidia Shield is an upcoming android (Jelly Bean)  based handheld gaming console from Nvidia which is currently available for pre-order for 349USD. The gaming console looks similar to Xbox 360 controller, but it comes with additional flip-up 5inch 720p (1280×720) display with built in integrated stereo speakers  and microphone. The amazing feature… Read More »

Read more
Alternative text

REGEX (Regular Expression) to Remove/Strip HTML Tags in PERL

The following regular expression can be used in Perl progamming language to remove/strip HTML tags in given string. Regular Expression: s/<(?:[^>'”]*|([‘”]).*?\1)*>//ig   Example: my $data ='<script>TEST</script> <img src="img.jpg">'; $data =~ s/<(?:[^>'"]*|(['"]).*?\1)*>//ig; print $data; Output: TEST

Read more
Alternative text

Elasticsearch – Date/Time(String) Add/Subtract Duration – Days,Months,Years,Hours,Minutes,Seconds

Sample Query : POST /test/test/_search { "query": { "filtered": { "filter": { "bool": { "must": [{ "range": { "dateOrTimeAttribute": { "from": "16:31:15", "to": "16:31:15||+10m" } } }] } } } } } Examples: “16:31:15||+10m” “16:31:15||+1d” “2016-02-02||-1M”  

Read more
Alternative text

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

[ LATEST STORIES ]

CATCH UP THE LATEST STORIES

[ SUBSCRIBE TO OUR BLOG ]