Revision: 17372
          http://sourceforge.net/p/gate/code/17372
Author:   valyt
Date:     2014-02-20 15:54:13 +0000 (Thu, 20 Feb 2014)
Log Message:
-----------
Scratch

Modified Paths:
--------------
    mimir/branches/5.0/mimir-test/src/gate/mimir/test/Scratch.java

Modified: mimir/branches/5.0/mimir-test/src/gate/mimir/test/Scratch.java
===================================================================
--- mimir/branches/5.0/mimir-test/src/gate/mimir/test/Scratch.java      
2014-02-20 15:45:05 UTC (rev 17371)
+++ mimir/branches/5.0/mimir-test/src/gate/mimir/test/Scratch.java      
2014-02-20 15:54:13 UTC (rev 17372)
@@ -50,6 +50,7 @@
 import gate.mimir.AbstractSemanticAnnotationHelper;
 import gate.mimir.IndexConfig;
 import gate.mimir.MimirIndex;
+import gate.mimir.index.AtomicIndex;
 import gate.mimir.index.AtomicTokenIndex;
 import gate.mimir.index.GATEDocument;
 import gate.mimir.search.IndexReaderPool;
@@ -71,6 +72,7 @@
 import gate.mimir.search.terms.LimitTermsQuery;
 import gate.mimir.search.terms.OrTermsQuery;
 import gate.mimir.search.terms.SortedTermsQuery;
+import gate.mimir.search.terms.TermTypeTermsQuery;
 import gate.mimir.search.terms.TermsQuery;
 import gate.mimir.search.terms.TermsResultSet;
 import gate.mimir.tool.WebUtils;
@@ -80,11 +82,12 @@
 public class Scratch {
 
   public static void main (String[] args) throws Exception {
-    mainIndexer5(args);
     
+//    mainIndexer5(args);
+    
 //     mainSimple(args);
     
-//     mainDirectIndexes(args);
+    mainDirectIndexes(args);
 //    mainBuildDirectIndex(args);
 //    mainQueryIndex(args);
 //    mainRemote(args);
@@ -184,7 +187,7 @@
 //    String query = "{Document date > 20070000}";
 //    String query = "{Abstract}";
    
-    String[] queries = new String[]{"electrical", "the", "{Abstract}", 
"{Document date > 20070000}"};
+    String[] queries = new String[]{"electrical", "the", "{Document date > 
20070000}"};
     long start = System.currentTimeMillis();
     NumberFormat nf = NumberFormat.getNumberInstance();
     for(String query : queries) {
@@ -270,7 +273,7 @@
     }
     
     if(compress){
-      mainIndex.requestDumpToDisk();
+      mainIndex.requestSyncToDisk();
       mainIndex.requestCompactIndex();
     }
     mainIndex.compactDocumentCollection();
@@ -303,8 +306,7 @@
     // build a token indexer
     BlockingQueue<GATEDocument> inputQueue = new 
LinkedBlockingQueue<GATEDocument>();
     BlockingQueue<GATEDocument> outputQueue = new 
LinkedBlockingQueue<GATEDocument>();
-    AtomicTokenIndex ati = new AtomicTokenIndex(mainIndex, "tokens-0", 
-        new File(indexDir, "tokens-0"), false, 
+    AtomicTokenIndex ati = new AtomicTokenIndex(mainIndex, "tokens-0", false, 
         inputQueue, outputQueue, 
         indexConfig.getTokenIndexers()[0], 
         false);
@@ -487,15 +489,24 @@
 //    
 //    query = new LimitTermsQuery(new SortedTermsQuery(query), 100);
     
+//    query = new LimitTermsQuery(
+//      new SortedTermsQuery(
+//      new DocumentsOrTermsQuery("root", IndexType.TOKENS, true, false, 0, 1, 
2))
+//      , 100);
+//    printTermQuery(query, qEngine);
+//    
+//    System.out.println("\n=======================================");
+    
     query = new LimitTermsQuery(
-      new SortedTermsQuery(
-      new DocumentsOrTermsQuery("root", IndexType.TOKENS, true, false, 0, 1, 
2))
-      , 100);
-    printTermQuery(query, qEngine);
+        new SortedTermsQuery(
+//        new TermTypeTermsQuery("root", IndexType.TOKENS))
+            new DocumentTermsQuery("root", IndexType.TOKENS, true, true, 1)
+        ), 100);
+      printTermQuery(query, qEngine);
+      
+      System.out.println("\n=======================================");
+      
     
-    System.out.println("\n=======================================");
-    
-    
     mainIndex.close();
   }
   

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to