@Test public void testVectorHighlighter() throws Exception {

    Directory dir = new RAMDirectory();
    IndexWriter indexWriter 
    	= new IndexWriter(dir, new IndexWriterConfig(Version.LUCENE_44, new WhitespaceAnalyzer(Version.LUCENE_44)));
    Document doc = new Document();
    FieldType fieldType = new FieldType();
eldType.setIndexed(true);
eldType.setStored(true);
eldType.setTokenized(true);
eldType.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS);
eldType.setStoreTermVectors(true);
    Field f1 = new Field("_id", "1", fieldType);
    Field f2 = new Field("content", "the big 삼성전자연구원. dog", fieldType);
    doc.add(f1);
    doc.add(f2);
    
    indexWriter.addDocument(doc);
    
    indexWriter.commit();
    indexWriter.close();
    
    DirectoryReader reader = DirectoryReader.open(dir);
    IndexSearcher searcher = new IndexSearcher(reader);
    TopDocs topDocs = searcher.search(new TermQuery(new Term("_id", "1")), 1);
    System.out.println(topDocs.totalHits);
     
    FastVectorHighlighter highlighter = new FastVectorHighlighter();
    String fragment = highlighter.getBestFragment(highlighter.getFieldQuery(new TermQuery(new Term("content", "big"))),
    		reader, topDocs.scoreDocs[0].doc, "content", 200);
   
    System.out.println(fragment);
}