Question: Also I want to know how to add meta data while indexing so that i can boost some parameters

Answer: 
You can use Apache [Tika](http://lucene.apache.org/tika/index.html). Tika is a toolkit for detecting and extracting metadata and structured text content from various documents using existing parser libraries.

Supported Document Formats

* HyperText Markup Language
* XML and derived formats
* Microsoft Office document formats
* OpenDocument Format
* Portable Document Format
* Electronic Publication Format
* Rich Text Format
* Compression and packaging formats
* Text formats
* Audio formats
* Image formats
* Video formats
* Java class files and archives
* The mbox format

The code will look like this.

Reader reader = new Tika().parse(stream);
see <https://github.com/WolfgangFahl/pdfindexer>
for a java solution that uses PDFBox and Apache Lucene to split the PDF files page by page to text,
index these text-pages and create a resulting html index file that links to the pages in the pdf sources by using a corresponding open parameter.