Hi,

In my index there is a unique field, "MY_DOCNO".

If I want get a document from the index with MY_DOCNO=1000,  I am using
following code,

IndexSearcher isearcher = new IndexSearcher("myindex1");
QueryParser qp = new QueryParser("MY_DOCNO", new StandardAnalyzer());

Query query = qp.parse("MY_DOCNO:1000");
Hits hits = isearcher.search(query);

Since I have a unique field in my index, is there any other method, that can
retrieve the document faster than this?

Thanks,
Sunil

Reply via email to