public static Index makeIndex(String[] docnos, String[] documents) throws Exception { count++; return makeIndex(docnos, documents, new BasicIndexer(ApplicationSetup.TERRIER_INDEX_PATH, ApplicationSetup.TERRIER_INDEX_PREFIX + '-'+ count), ApplicationSetup.TERRIER_INDEX_PATH, ApplicationSetup.TERRIER_INDEX_PREFIX + '-'+ count); }
public static Index makeIndexFields(String[] docnos, String[] documents) throws Exception { count++; return makeIndexFields(docnos, documents, new BasicIndexer(ApplicationSetup.TERRIER_INDEX_PATH, ApplicationSetup.TERRIER_INDEX_PREFIX + '-'+ count), ApplicationSetup.TERRIER_INDEX_PATH, ApplicationSetup.TERRIER_INDEX_PREFIX + '-'+ count); }
public static Index makeIndex(String[] docnos, String[] documents) throws Exception { return makeIndex(docnos, documents, new BasicIndexer(ApplicationSetup.TERRIER_INDEX_PATH, ApplicationSetup.TERRIER_INDEX_PREFIX)); }
@Test public void testBasicNoFields() throws Exception { ApplicationSetup.setProperty("FieldTags.process", ""); testIndexer(new BasicIndexer(ApplicationSetup.TERRIER_INDEX_PATH, ApplicationSetup.TERRIER_INDEX_PREFIX), true, false); }
@Test public void testBasicFields() throws Exception { ApplicationSetup.setProperty("FieldTags.process", "TITLE,ELSE"); testIndexer(new BasicIndexer(ApplicationSetup.TERRIER_INDEX_PATH, "fields"), true, true); }
public IndexOnDisk disk(int prefix) { System.err.println("disk()"); ApplicationSetup.setProperty("indexer.meta.forward.keys", "filename"); ApplicationSetup.setProperty("indexer.meta.forward.keylens", "100"); ApplicationSetup.setProperty("indexer.meta.reverse.keys", "filename"); ApplicationSetup.setProperty("termpipelines", ""); Document[] docs1 = new Document[] { new FileDocument("doc1", new ByteArrayInputStream( "curry church turing knuth".getBytes()), new EnglishTokeniser()), new FileDocument("doc2", new ByteArrayInputStream( "turing knuth knuth turing".getBytes()), new EnglishTokeniser()) }; Collection coll = new CollectionDocumentList(docs1, "filename"); BasicIndexer indexer = new BasicIndexer( ApplicationSetup.TERRIER_INDEX_PATH, ApplicationSetup.TERRIER_INDEX_PREFIX + "-" + String.valueOf(prefix)); assertNotNull(indexer); indexer.createDirectIndex(new Collection[] { coll }); indexer.createInvertedIndex(); IndexOnDisk index = (IndexOnDisk) Index.createIndex( ApplicationSetup.TERRIER_INDEX_PATH, ApplicationSetup.TERRIER_INDEX_PREFIX + "-" + String.valueOf(prefix)); assertNotNull(index); System.err.println("done"); return index; }