Package ivory.core.data.index

Examples of ivory.core.data.index.PostingsAccumulator


      IntDocVector.Reader r = doc.getReader();
      int term;
      int[] tp;

      int dl = 0;
      PostingsAccumulator pl;
      while (r.hasMoreTerms()) {
        term = r.nextTerm();
        tp = r.getPositions();
        pl = partialPostings.get(term);
        if (pl == null) {
          pl = new PostingsAccumulator();
          partialPostings.put(term, pl);
        }
        pl.add(docno, tp);
        dl += tp.length;
      }
      context.getCounter(MapTime.Parsing).increment(System.currentTimeMillis() - startTime);

      // Update number of indexed terms.
View Full Code Here


      long startTime = System.currentTimeMillis();
      for (MapIV.Entry<PostingsAccumulator> e : partialPostings.entrySet()) {
        // Emit a partial posting list for each term.
        TERM.set(e.getKey());
        context.setStatus("t" + TERM.get());
        PostingsAccumulator pl = e.getValue();
        postingsList.clear();
        postingsList.setCollectionDocumentCount(collectionDocumentCount);
        postingsList.setNumberOfPostings(pl.size());

        int[] docnos = pl.getDocnos();
        int[][] positions = pl.getPositions();
        QuickSort.quicksortWithStack(positions, docnos, 0, pl.size() - 1);
        for (int i = 0; i < pl.size(); i++) {
          tp.set(positions[i], (short) positions[i].length);
          postingsList.add(docnos[i], tp.getTf(), tp);
        }
        context.write(TERM, postingsList);
      }
View Full Code Here

      IntDocVector.Reader r = doc.getReader();
      int term;
      int[] tp;

      int dl = 0;
      PostingsAccumulator pl;
      while (r.hasMoreTerms()) {
        term = r.nextTerm();
        tp = r.getPositions();
        pl = partialPostings.get(term);
        if (pl == null) {
          pl = new PostingsAccumulator();
          partialPostings.put(term, pl);
        }
        pl.add(docno, tp);
        dl += tp.length;
      }
      context.getCounter(MapTime.Parsing).increment(System.currentTimeMillis() - startTime);

      // Update number of indexed terms.
View Full Code Here

      long startTime = System.currentTimeMillis();
      for (MapIV.Entry<PostingsAccumulator> e : partialPostings.entrySet()) {
        // Emit a partial posting list for each term.
        TERM.set(e.getKey());
        context.setStatus("t" + TERM.get());
        PostingsAccumulator pl = e.getValue();
        postingsList.clear();
        postingsList.setCollectionDocumentCount(collectionDocumentCount);
        postingsList.setNumberOfPostings(pl.size());

        int[] docnos = pl.getDocnos();
        int[][] positions = pl.getPositions();
        QuickSort.quicksortWithStack(positions, docnos, 0, pl.size() - 1);
        for (int i = 0; i < pl.size(); i++) {
          tp.set(positions[i], (short) positions[i].length);
          postingsList.add(docnos[i], tp.getTf(), tp);
        }
        context.write(TERM, postingsList);
      }
View Full Code Here

      IntDocVector.Reader r = doc.getReader();
      int term;
      int[] tp;

      int dl = 0;
      PostingsAccumulator pl;
      while (r.hasMoreTerms()) {
        term = r.nextTerm();
        tp = r.getPositions();
        pl = partialPostings.get(term);
        if (pl == null) {
          pl = new PostingsAccumulator();
          partialPostings.put(term, pl);
        }
        pl.add(docno, tp);
        dl += tp.length;
      }
      context.getCounter(MapTime.Parsing).increment(System.currentTimeMillis() - startTime);

      // Update number of indexed terms.
View Full Code Here

      long startTime = System.currentTimeMillis();
      for (MapIV.Entry<PostingsAccumulator> e : partialPostings.entrySet()) {
        // Emit a partial posting list for each term.
        TERM.set(e.getKey());
        context.setStatus("t" + TERM.get());
        PostingsAccumulator pl = e.getValue();
        postingsList.clear();
        postingsList.setCollectionDocumentCount(collectionDocumentCount);
        postingsList.setNumberOfPostings(pl.size());

        int[] docnos = pl.getDocnos();
        int[][] positions = pl.getPositions();
        QuickSort.quicksortWithStack(positions, docnos, 0, pl.size() - 1);
        for (int i = 0; i < pl.size(); i++) {
          tp.set(positions[i], (short) positions[i].length);
          postingsList.add(docnos[i], tp.getTf(), tp);
        }
        context.write(TERM, postingsList);
      }
View Full Code Here

TOP

Related Classes of ivory.core.data.index.PostingsAccumulator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.