Archive for June, 2011


I love to listen music while coding. First of all it helps me block out external distractions and secondly it makes me concentrate better.

Though i prefer instrumental music while coding, its good to get pumped up with couple of songs :

ROCKY TRIBUTE – EYE OF THE TIGER

Queen – We Are The Champions

Now time for some instrumental music

P.S. list is full of unconventional music

Death Note Soundtrack – L’s Theme 

First one is L’s theme from Death Note, absolute EPIC !!

Requiem for a Dream – soundtrack

This one is from the movie Requiem for a dream, one of my all time favorite.

Ewan Dobson – Time 2 – Guitar

The Arrancar Theme

Spanish classical guitar from anime Bleach

Metallica – Call of Cthulhu 

Masterpiece from Metallica

Epic Trance Techno- Fantasy

Inception Soundtrack-Dream is Collapsing

Santana – Europa

Godot – The Fragrance of Dark Coffee

This theme combined with http://www.rainymood.com/ forms an awesome combo.

The Matrix Soundtrack – Clubbed to death

Apocalyptica – Quutamo live

Half life 2 – Vortal Combat

Lastly, an awesome soundtrack from Half life 2

Also there are some good soundtracks here  http://www.amazon.com/Social-Network-Trent-Reznor/dp/B0043ISH6O/ . Also some of them like Fur Elise http://www.youtube.com/watch?v=P-B4sjUve3E and Clair de Lune http://www.youtube.com/watch?v=-LXl4y6D-QI didn’t qualified cause it is difficult to not get lost in them.

Here is a short intro on using elasticsearch filters with java.

Combining filters

        XContentFilterBuilder filter1 = FilterBuilders.orFilter(
				FilterBuilders.termsFilter("disclaimer","searchKeyword"),
				FilterBuilders.termsFilter("foootnote", "searchKeyword"))
				.filterName(filter11);
//filter name can be used later to find matched filter
		XContentFilterBuilder filter2 = FilterBuilders.orFilter(
				FilterBuilders.termsFilter("senderNumber","searchKeyword"),
				FilterBuilders.termsFilter("receiverNumber", "searchKeyword"))
				.filterName(filter22);

        XContentFilterBuilder filter33 = FilterBuilders.orFilter(
        		FilterBuilders.termFilter("messageText", "searchKeyword"),
        		FilterBuilders.termFilter("messageSubject", "searchKeyword").
        		filterName(filter33);

        // These filter can then be combined using one more filter
        XContentFilterBuilder messageFilter = FilterBuilders.orFilter(filter1, filter2, filter3);



Checking for presence of a keyword( i.e. NOT NULL)

Here’s an example in which a filter is created to check for the existence of a keyword “hiddenTag”.

XContentFilterBuilder existsFilter = FilterBuilders.notFilter(
        		FilterBuilders.missingFilter("hiddenTag"));
//This filter can then be combined with other filters like below
messageFilter = FilterBuilders.andFilter(messageFilter, notExistsFilter);



Pagination

By default only 10 results are returned. To return more results and apply pagination we can build our query like this :

qb = QueryBuilders.filteredQuery(qb, messageFilter);
builder.setQuery(qb).setFrom((pageNumber-1)*pageSize).setSize(pageSize);