@@ -0,0 +1,1532 @@
+package com.lucene;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.util.ArrayList;%0A%0Aimport jxl.Cell;%0Aimport jxl.Sheet;%0Aimport jxl.Workbook;%0Aimport jxl.read.biff.BiffException;%0A%0Aimport org.apache.lucene.document.Document;%0Aimport org.apache.lucene.document.Field;%0A%0Apublic class CategoryNews %7B%0A%0A%09public CategoryNews() %7B%0A%0A%09%7D%0A%0A%09public ArrayList %3CDocument%3E GenerateCategoryData(Document document, String newsURL) throws IOException, BiffException %7B%0A%0A%09%09File file = new File(LuceneConstants.FILE_PATH_CATEGORY);%0A%0A%09%09ArrayList%3CDocument%3E coreDocumentsArray = new ArrayList%3CDocument%3E();%0A%0A%09%09Workbook workBook = Workbook.getWorkbook(file);%0A%09%09Sheet sh1 = workBook.getSheet(0);%0A%0A%09%09Cell columns0%5B%5D = sh1.getColumn(0);%0A%0A%09%09for (int i = 0; i %3C columns0.length; i++) %7B%0A%0A%09%09%09String value0 = columns0%5Bi%5D.getContents();%0A%0A%09%09%09if (value0.equalsIgnoreCase(newsURL)) %7B%0A%0A%09%09%09%09Cell columns2%5B%5D = sh1.getColumn(2);%0A%0A%09%09%09%09String value2 = columns2%5Bi%5D.getContents();%0A%0A%09%09%09%09Field CATEGORY_NEWS = new Field(LuceneConstants.CATEGORY_NEWS, value2, Field.Store.YES,Field.Index.ANALYZED,Field.TermVector.WITH_POSITIONS_OFFSETS);%0A%0A%09%09%09%09Field fileNameField = new Field(LuceneConstants.FILE_NAME,file.getName(),Field.Store.YES,Field.Index.NOT_ANALYZED);%0A%09%09%09%09Field filePathField = new Field(LuceneConstants.FILE_PATH,file.getCanonicalPath(),Field.Store.YES,Field.Index.NOT_ANALYZED);%0A%0A%09%09%09%09document.add(CATEGORY_NEWS);%0A%09%09%09%09document.add(filePathField);%0A%09%09%09%09document.add(fileNameField);%0A%0A%09%09%09%09coreDocumentsArray.add(document);%0A%09%09%09%7D%0A%09%09%7D%0A%0A%09%09return coreDocumentsArray;%0A%09%7D%0A%0A%7D%0A

Create CategoryNews Class to Handle Modeled Data