[Quick Start] Lucene

Lucene is a full-text search library in Java.It does so by adding content to a full-text index. It then allows you to perform queries on this index, returning results ranked by either the relevance to the query or sorted by an arbitrary field such as a document’s last modified date.The content you add to Lucene can be from various sources, like a SQL/NoSQL database, a filesystem, or even from websites.

Searching & Indexing:

Lucene is fast because it uses indexes for searching instead of searching for the text directly. It uses a Inverted index for searching as it inverts the page centric searching(page->word) to keyword centric searching(word->page). It is similar to searching for keyword related pages at the end of the book instead of searching all pages for the keyword.

Document is the unit of search and index. It consists of one or more fields(key-value pair). Indexing involves adding Documents to an IndexWriter, and searching involves retrieving Documents from an index via an IndexSearcher.

IndexProcess

Query:

Querying is done by its own mini language. The Lucene query language allows the user to specify which field(s) to search on, which fields to give more weight to (boosting), the ability to perform boolean queries (AND, OR, NOT) and other functionality.

SearchProcess

More on how to use Lucene in programs can be found in tutorialspoint

 

Advertisements

Apache Thrift: Introduction

Thrift is an interface definition language and binary communication protocol that is used to define and create services for numerous languages. It is used as a remote procedure call(RPC) framework and was developed at Facebook for “scalable cross-language services development”.  The Apache Thrift software framework combines a software stack with a code generation engine to build services that work efficiently and seamlessly between almost any language.

 

There’s a lot of repeated work you have to do when you’re writing a server – primarily designing a protocol and writing code to serialize and deserialize messages on the protocol, but also dealing with sockets and managing concurrency, and writing clients in many languages. Thrift automatically does all of this, given a description of the functions you want to expose from your server to clients. It’s also useful for serializing data on disk or into shared memory (where many of the same problems come up).

Windows Tricks: Add Locations to Send To menu

  • Create Shortcuts to the folders that you would like to add in “Send To” menu.
  • Type in “shell:sendto” in windows explorer location bar at the top and press enter.
  • You will be taken to a folder. Copy the shortcuts of the folder that you want to add in “Send To” menu.

That’s it ! Right click and check out the new folders added to the menu.

About pages in Mozilla Firefox

Mozilla has hidden various configuration and diagnostic information in its internal about pages. Some of the important about pages are ,

1. About:Mozilla
This page contains a verse from the Book of Mozilla.This was first introduced in 1994.
2. About:Config
The contents of this page has already been discussed here.

3. About:Crashes
You’ll find Firefox’s crash reports on the about:crashes page. Click a crash report and it’ll be submitted to Mozilla, where you can view information about it.If you’re struggling with a crash, you can use the information here to figure out what the problem is. Googling up some of the crash messages might help you determine the problem.

4. About:Permissions
Firefox includes website-specific permissions, which you can manage for a single website by right-clicking on a web page selecting View Page Info. About:permissions shows you all this information in one place.

5. About:About
Here you can find all the about pages in Firefox. Try out each one. It will help you to use Firefox efficiently.

Search like a Boss with Firefox

Firefox aids your searches by auto-filling suggested sites based on your bookmarks and browsing history below your search bar.This can be an overwhelming form of assistance particularly if you have many bookmarks and a voluminous browsing history. Fortunately, you can refine this search using the following modifiers

^ for matches in your browsing history
* for matches in your bookmarks
+ for matches in pages you’ve tagged
% for matches in your currently open tabs
~ for matches in pages you’ve typed
# for matches in page titles
@ for matches in web addresses (URLs).

Syntax: <keyword> <space> <modifiers>

Note: You can also use multiple modifiers(with space in between) in same search itself.

Tricks on Google

  • Type “Atari Breakout” in Google Image.
  • Use Google as a Timer. “Set Timer for 19.00”
  • Type “Zerg Rush”,”Tilt”,”do a barrel roll” and “google gravity” and hit the search or feeling lucky button and check what happens.
  • Search for “Google in 1998”, this will take you to the old version of google.
  • Type ‘graph for sin(x)+cos(x)” and check . this will work for all trignometric functions.
  • Find “sunrise and sunset time”
  • Ue google as calculator, tip calculator,currency converter,distance finder and also get details about flight timings.
  • Search for recursion and end up in recursive searches.
  • Try “Solve Circle/Square” or any other shapes and google will help you to solve any Geometric problems