Click here to Skip to main content
15,921,226 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have requirement where i need to search only the first page of the file. Currently i am using lucene.net with WPF for creating the indexes and searching the entire content of the file. i am able to return the results succefully. Now i need to search only the first page of the file i.e. Each document will have a standard proforma which will have a specific location where keywords are assigned. So can someone please guide me on this !!!
Posted

1 solution

If your data is standardized then you can easily add fields from the first page to your index and search that instead of the document body.
C#
Document document = new Document();
document.add(Field.Text("invoicedate", "2012/1/1"));
document.add(Field.Text("invoiceno", "something"));
indexWriter.addDocument(document);
 
Share this answer
 
Comments
karthikkaliber 12-Jan-12 0:27am    
Thanks for the reply, 1) how do i add fields and indexes for the FIRST PAGE aand search can u pls post the code how to read the first page or any one particuler page number alone in the entire document
2) My data for searching the keywords are not standard it varies from each and every document!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900