lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1201347 - in /lucene/dev/branches/lucene2621/lucene/contrib: instantiated/src/java/org/apache/lucene/store/instantiated/ instantiated/src/test/org/apache/lucene/store/instantiated/ misc/src/java/org/apache/lucene/index/ misc/src/test/org/a...
Date Sat, 12 Nov 2011 22:32:19 GMT
Author: mikemccand
Date: Sat Nov 12 22:32:18 2011
New Revision: 1201347

URL: http://svn.apache.org/viewvc?rev=1201347&view=rev
Log:
LUCENE-2621: contrib passes

Removed:
    lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedTermFreqVector.java
    lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedTermPositionVector.java
    lucene/dev/branches/lucene2621/lucene/contrib/misc/src/java/org/apache/lucene/index/TermVectorAccessor.java
    lucene/dev/branches/lucene2621/lucene/contrib/misc/src/test/org/apache/lucene/index/TestTermVectorAccessor.java
Modified:
    lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndex.java
    lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndexReader.java
    lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndexWriter.java
    lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedTermDocumentInformation.java
    lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java

Modified: lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndex.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndex.java?rev=1201347&r1=1201346&r2=1201347&view=diff
==============================================================================
--- lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndex.java
(original)
+++ lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndex.java
Sat Nov 12 22:32:18 2011
@@ -36,7 +36,6 @@ import org.apache.lucene.index.Fields;
 import org.apache.lucene.index.FieldsEnum;
 import org.apache.lucene.index.DocsEnum;
 import org.apache.lucene.index.MultiFields;
-import org.apache.lucene.index.TermPositionVector;
 import org.apache.lucene.index.DocsAndPositionsEnum;
 import org.apache.lucene.util.BitVector;
 import org.apache.lucene.util.Bits;
@@ -286,6 +285,7 @@ public class InstantiatedIndex
     }
 
     // load offsets to term-document informations
+    /*
     for (InstantiatedDocument document : getDocumentsByNumber()) {
       if (document == null) {
         continue; // deleted
@@ -304,6 +304,7 @@ public class InstantiatedIndex
         }
       }
     }
+    */
   }
 
   public InstantiatedIndexWriter indexWriterFactory(Analyzer analyzer, boolean create) throws
IOException {

Modified: lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndexReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndexReader.java?rev=1201347&r1=1201346&r2=1201347&view=diff
==============================================================================
--- lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndexReader.java
(original)
+++ lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndexReader.java
Sat Nov 12 22:32:18 2011
@@ -410,6 +410,12 @@ public class InstantiatedIndexReader ext
           }
         };
       }
+
+      @Override
+      public int getUniqueFieldCount() {
+        // nocommit can we do this easily?
+        return -1;
+      }
     };
   }
   
@@ -419,50 +425,9 @@ public class InstantiatedIndexReader ext
   }
 
   @Override
-  public TermFreqVector[] getTermFreqVectors(int docNumber) throws IOException {
-    InstantiatedDocument doc = getIndex().getDocumentsByNumber()[docNumber];
-    if (doc.getVectorSpace() == null) {
-      return null;
-    }
-    TermFreqVector[] ret = new TermFreqVector[doc.getVectorSpace().size()];
-    Iterator<String> it = doc.getVectorSpace().keySet().iterator();
-    for (int i = 0; i < ret.length; i++) {
-      ret[i] = new InstantiatedTermPositionVector(getIndex().getDocumentsByNumber()[docNumber],
it.next());
-    }
-    return ret;
-  }
-
-  @Override
-  public TermFreqVector getTermFreqVector(int docNumber, String field) throws IOException
{
-    InstantiatedDocument doc = getIndex().getDocumentsByNumber()[docNumber];
-    if (doc.getVectorSpace() == null || doc.getVectorSpace().get(field) == null) {
-      return null;
-    } else {
-      return new InstantiatedTermPositionVector(doc, field);
-    }
-  }
-
-  @Override
-  public void getTermFreqVector(int docNumber, String field, TermVectorMapper mapper) throws
IOException {
-    InstantiatedDocument doc = getIndex().getDocumentsByNumber()[docNumber];
-    if (doc.getVectorSpace() != null && doc.getVectorSpace().get(field) == null)
{
-      List<InstantiatedTermDocumentInformation> tv = doc.getVectorSpace().get(field);
-      mapper.setExpectations(field, tv.size(), true, true);
-      for (InstantiatedTermDocumentInformation tdi : tv) {
-        mapper.map(tdi.getTerm().getTerm().bytes(), tdi.getTermPositions().length, tdi.getTermOffsets(),
tdi.getTermPositions());
-      }
-    }
-  }
-
-  @Override
-  public void getTermFreqVector(int docNumber, TermVectorMapper mapper) throws IOException
{
-    InstantiatedDocument doc = getIndex().getDocumentsByNumber()[docNumber];
-    for (Map.Entry<String, List<InstantiatedTermDocumentInformation>> e : doc.getVectorSpace().entrySet())
{
-      mapper.setExpectations(e.getKey(), e.getValue().size(), true, true);
-      for (InstantiatedTermDocumentInformation tdi : e.getValue()) {
-        mapper.map(tdi.getTerm().getTerm().bytes(), tdi.getTermPositions().length, tdi.getTermOffsets(),
tdi.getTermPositions());
-      }
-    }
+  public Fields getTermVectors(int docID) throws IOException {
+    // nocommit
+    return null;
   }
 
   @Override

Modified: lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndexWriter.java?rev=1201347&r1=1201346&r2=1201347&view=diff
==============================================================================
--- lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndexWriter.java
(original)
+++ lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndexWriter.java
Sat Nov 12 22:32:18 2011
@@ -41,7 +41,7 @@ import org.apache.lucene.index.FieldInve
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.index.Term;
-import org.apache.lucene.index.TermVectorOffsetInfo;
+//import org.apache.lucene.index.TermVectorOffsetInfo;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.similarities.SimilarityProvider;
 import org.apache.lucene.util.ArrayUtil;
@@ -325,6 +325,8 @@ public class InstantiatedIndexWriter imp
         }
 
         // term vector offsets
+        // nocommit
+        /*
         if (eFieldSetting_TermDocInfoFactoriesByTermText.getKey().storeOffsetWithTermVector)
{
           for (Map.Entry<InstantiatedTerm, InstantiatedTermDocumentInformation> e :
informationByTermOfCurrentDocument.entrySet()) {
             if (eFieldSetting_TermDocInfoFactoriesByTermText.getKey().fieldName.equals(e.getKey().field()))
{
@@ -333,6 +335,7 @@ public class InstantiatedIndexWriter imp
             }
           }
         }
+        */
       }
 
       Map<String, List<InstantiatedTermDocumentInformation>> termDocumentInformationsByField
= new HashMap<String, List<InstantiatedTermDocumentInformation>>();
@@ -576,7 +579,7 @@ public class InstantiatedIndexWriter imp
         termDocumentInformationFactoryByTermTextAndFieldSetting.put(fieldSettingsByFieldName.get(eField_Tokens.getKey().name()),
termDocumentInformationFactoryByTermText);
       }
 
-      int lastOffset = 0;
+      // int lastOffset = 0;
 
       // for each new field, move positions a bunch.
       if (fieldSetting.position > 0) {
@@ -603,18 +606,22 @@ public class InstantiatedIndexWriter imp
           termDocumentInformationFactory.payloads.add(null);
         }
 
+        /*
         if (eField_Tokens.getKey().fieldType().storeTermVectorOffsets()) {
 
           termDocumentInformationFactory.termOffsets.add(new TermVectorOffsetInfo(fieldSetting.offset
+ token.startOffset(), fieldSetting.offset + token.endOffset()));
           lastOffset = fieldSetting.offset + token.endOffset();
         }
+        */
 
 
       }
 
+      /*
       if (eField_Tokens.getKey().fieldType().storeTermVectorOffsets()) {
         fieldSetting.offset = lastOffset + 1;
       }
+      */
 
     }
 
@@ -667,7 +674,7 @@ public class InstantiatedIndexWriter imp
   private class TermDocumentInformationFactory {
     private LinkedList<byte[]> payloads = new LinkedList<byte[]>();
     private LinkedList<Integer> termPositions = new LinkedList<Integer>();
-    private LinkedList<TermVectorOffsetInfo> termOffsets = new LinkedList<TermVectorOffsetInfo>();
+    //private LinkedList<TermVectorOffsetInfo> termOffsets = new LinkedList<TermVectorOffsetInfo>();
   }
 
 

Modified: lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedTermDocumentInformation.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedTermDocumentInformation.java?rev=1201347&r1=1201346&r2=1201347&view=diff
==============================================================================
--- lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedTermDocumentInformation.java
(original)
+++ lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedTermDocumentInformation.java
Sat Nov 12 22:32:18 2011
@@ -62,7 +62,7 @@ public class InstantiatedTermDocumentInf
   private int[] termPositions;
   private InstantiatedTerm term;
   private InstantiatedDocument document;
-  private TermVectorOffsetInfo[] termOffsets;
+  //private TermVectorOffsetInfo[] termOffsets;
 
 
 
@@ -123,6 +123,7 @@ public class InstantiatedTermDocumentInf
     this.document = document;
   }
 
+  /*
   public TermVectorOffsetInfo[] getTermOffsets() {
     return termOffsets;
   }
@@ -130,4 +131,5 @@ public class InstantiatedTermDocumentInf
   void setTermOffsets(TermVectorOffsetInfo[] termOffsets) {
     this.termOffsets = termOffsets;
   }
+  */
 }

Modified: lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java?rev=1201347&r1=1201346&r2=1201347&view=diff
==============================================================================
--- lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java
(original)
+++ lucene/dev/branches/lucene2621/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java
Sat Nov 12 22:32:18 2011
@@ -41,8 +41,6 @@ import org.apache.lucene.index.DocsAndPo
 import org.apache.lucene.index.MultiFields;
 import org.apache.lucene.index.TermsEnum;
 import org.apache.lucene.index.FieldsEnum;
-import org.apache.lucene.index.TermFreqVector;
-import org.apache.lucene.index.TermPositionVector;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.AttributeImpl;
 import org.apache.lucene.util.LuceneTestCase;
@@ -514,12 +512,13 @@ public class TestIndicesEquals extends L
 
     for (int documentNumber = 0; documentNumber < aprioriReader.numDocs(); documentNumber++)
{
 
+      /*
       if (documentNumber > 0) {
-        assertNotNull(aprioriReader.getTermFreqVector(documentNumber, "b0"));
-        assertNull(aprioriReader.getTermFreqVector(documentNumber, "b1"));
+        assertNotNull(aprioriReader.getTermVector(documentNumber, "b0"));
+        assertNull(aprioriReader.getTermVector(documentNumber, "b1"));
 
-        assertNotNull(testReader.getTermFreqVector(documentNumber, "b0"));
-        assertNull(testReader.getTermFreqVector(documentNumber, "b1"));
+        assertNotNull(testReader.getTermVector(documentNumber, "b0"));
+        assertNull(testReader.getTermVector(documentNumber, "b1"));
 
       }
 
@@ -563,6 +562,7 @@ public class TestIndicesEquals extends L
 
         }
       }
+      */
     }
 
     aprioriReader.close();



Mime
View raw message