Last active
January 7, 2019 21:38
-
-
Save redcho/609ffc4016edcf02216406b2d822b5a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.lucene.index.DirectoryReader; | |
import org.apache.lucene.index.IndexReader; | |
import org.apache.lucene.store.Directory; | |
import org.apache.lucene.store.FSDirectory; | |
public class Main { | |
public static void main(String[] args) throws IOException { | |
String luceneIndexPath = "my-elasticsearch/data/nodes/0/indices/eCCAJ-x6SOuN6w7vqr4tGQ/0/index"; | |
Directory index = FSDirectory.open(Paths.get(luceneIndexPath)); | |
IndexReader reader = DirectoryReader.open(index); | |
System.out.println(reader.maxDoc()); | |
reader.close(); | |
index.close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment