class ProductIndex {

	public List<ProductCatalogEntry> search(String queryString) throws IOException, ParseException {
		List<ProductCatalogEntry> results = new ArrayList<ProductCatalogEntry>();
		
		IndexReader reader = DirectoryReader.open(dir);
		IndexSearcher searcher = new IndexSearcher(reader);
		Analyzer analyzer = new SimpleAnalyzer();
		
		QueryParser parser = new QueryParser(searchField, analyzer);
		Query query = parser.parse(queryString);
		
		TopDocs docs = searcher.search(query, 100);
		ScoreDoc[] hits = docs.scoreDocs;
		
		for (ScoreDoc sd: hits) {
			Document doc = searcher.doc(sd.doc);
			results.add(prodcat.getProductById(doc.get("id")));
		}
		reader.close();
		
		return results;
	}

	public  ProductIndex(ProductCatalog prodcat);

}