improving the javadoc

I found the javadoc wording confusing and hard to read. Added a URL to
inverted index and tried to explain it with an example