Author: mikemccand
Date: Mon Apr 11 10:56:46 2011
New Revision: 1091020
URL: http://svn.apache.org/viewvc?rev=1091020&view=rev
Log:
add commented out code to write the dot-file for the FST index
Modified:
lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/VariableGapTermsIndexReader.java
Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/VariableGapTermsIndexReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/VariableGapTermsIndexReader.java?rev=1091020&r1=1091019&r2=1091020&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/VariableGapTermsIndexReader.java
(original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/VariableGapTermsIndexReader.java
Mon Apr 11 10:56:46 2011
@@ -18,6 +18,9 @@ package org.apache.lucene.index.codecs;
*/
import java.io.IOException;
+import java.io.FileOutputStream; // for toDot
+import java.io.OutputStreamWriter; // for toDot
+import java.io.Writer; // for toDot
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
@@ -34,6 +37,7 @@ import org.apache.lucene.util.automaton.
import org.apache.lucene.util.automaton.fst.BytesRefFSTEnum;
import org.apache.lucene.util.automaton.fst.FST;
import org.apache.lucene.util.automaton.fst.PositiveIntOutputs;
+import org.apache.lucene.util.automaton.fst.Util; // for toDot
/** See {@link VariableGapTermsIndexWriter}
*
@@ -52,11 +56,13 @@ public class VariableGapTermsIndexReader
// start of the field info data
protected long dirOffset;
+ final String segment;
+
public VariableGapTermsIndexReader(Directory dir, FieldInfos fieldInfos, String segment,
int indexDivisor, String codecId)
throws IOException {
in = dir.openInput(IndexFileNames.segmentFileName(segment, codecId, VariableGapTermsIndexWriter.TERMS_INDEX_EXTENSION));
-
+ this.segment = segment;
boolean success = false;
try {
@@ -176,6 +182,14 @@ public class VariableGapTermsIndexReader
fst = new FST<Long>(clone, fstOutputs);
clone.close();
+ /*
+ final String dotFileName = segment + "_" + fieldInfo.name + ".dot";
+ Writer w = new OutputStreamWriter(new FileOutputStream(dotFileName));
+ Util.toDot(fst, w, false, false);
+ System.out.println("FST INDEX: SAVED to " + dotFileName);
+ w.close();
+ */
+
if (indexDivisor > 1) {
// subsample
final PositiveIntOutputs outputs = PositiveIntOutputs.getSingleton(true);
|