Package org.apache.lucene.index

Examples of org.apache.lucene.index.IndexReader.termDocs()


            throws IOException {
        IndexReader reader = index.getIndexReader();
        try {
            checkRewritten(reader);
            Term idTerm = new Term(FieldNames.UUID, id.toString());
            TermDocs tDocs = reader.termDocs(idTerm);
            int docNumber;
            Document doc;
            try {
                if (tDocs.next()) {
                    docNumber = tDocs.doc();
View Full Code Here


  }

  private void verifyTermDocs(Directory dir, Term term, int numDocs)
      throws IOException {
    IndexReader reader = IndexReader.open(dir);
    TermDocs termDocs = reader.termDocs(term);
    int count = 0;
    while (termDocs.next())
      count++;
    assertEquals(numDocs, count);
    reader.close();
View Full Code Here

            throws IOException {
        IndexReader reader = index.getIndexReader();
        try {
            checkRewritten(reader);
            Term idTerm = TermFactory.createUUIDTerm(id.toString());
            TermDocs tDocs = reader.termDocs(idTerm);
            int docNumber;
            Document doc;
            try {
                if (tDocs.next()) {
                    docNumber = tDocs.doc();
View Full Code Here

            throws IOException {
        IndexReader reader = index.getIndexReader();
        try {
            checkRewritten(reader);
            Term idTerm = new Term(FieldNames.UUID, id.toString());
            TermDocs tDocs = reader.termDocs(idTerm);
            int docNumber;
            Document doc;
            try {
                if (tDocs.next()) {
                    docNumber = tDocs.doc();
View Full Code Here

                            + this.action.size());
        closeWriter();
        openSearcher();

        IndexReader reader = this.searcher.getIndexReader();
        TermDocs termDocs = reader.termDocs();
        for (Map.Entry<IndexDocument, Integer> entry : this.action.entrySet()) {
            IndexDocument indexDocument = entry.getKey();
            Integer docToKeep = entry.getValue();
            // extend the array if needed
            if (this.documentNumber == null
View Full Code Here

            if (!rewritten) {
                query = query.rewrite(reader);
                rewritten = true;
            }
            Term idTerm = new Term(FieldNames.UUID, id.getUUID().toString());
            TermDocs tDocs = reader.termDocs(idTerm);
            int docNumber;
            Document doc;
            try {
                if (tDocs.next()) {
                    docNumber = tDocs.doc();
View Full Code Here

  }

  private void verifyTermDocs(Directory dir, Term term, int numDocs)
      throws IOException {
    IndexReader reader = IndexReader.open(dir);
    TermDocs termDocs = reader.termDocs(term);
    int count = 0;
    while (termDocs.next())
      count++;
    assertEquals(numDocs, count);
    reader.close();
View Full Code Here

    // Separately count how many tokens are actually in the index:
    IndexReader reader = IndexReader.open(benchmark.getRunData().getDirectory());
    assertEquals(NUM_DOCS, reader.numDocs());

    TermEnum terms = reader.terms();
    TermDocs termDocs = reader.termDocs();
    int totalTokenCount2 = 0;
    while(terms.next()) {
      termDocs.seek(terms.term());
      while(termDocs.next())
        totalTokenCount2 += termDocs.freq();
View Full Code Here

            throws IOException {
        IndexReader reader = index.getIndexReader();
        try {
            checkRewritten(reader);
            Term idTerm = TermFactory.createUUIDTerm(id.toString());
            TermDocs tDocs = reader.termDocs(idTerm);
            int docNumber;
            Document doc;
            try {
                if (tDocs.next()) {
                    docNumber = tDocs.doc();
View Full Code Here

            try {
                IndexReader reader = index.getIndexReader();
                try {
                    Term aggregateUUIDs = new Term(
                            FieldNames.AGGREGATED_NODE_UUID, "");
                    TermDocs tDocs = reader.termDocs();
                    try {
                        ItemStateManager ism = getContext().getItemStateManager();
                        for (Iterator it = removedNodeIds.iterator(); it.hasNext(); ) {
                            NodeId id = (NodeId) it.next();
                            aggregateUUIDs = aggregateUUIDs.createTerm(
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.