Package org.apache.lucene.index

Examples of org.apache.lucene.index.TermDocs.doc()


                try {
                    if (docs.next()) {
                        // put to cache
                        cache.put(term.text(), this, docs.doc());
                        // and return
                        return new SingleTermDocs(docs.doc());
                    } else {
                        return EmptyTermDocs.INSTANCE;
                    }
                } finally {
                    docs.close();
View Full Code Here


                            aggregateIds =
                                aggregateIds.createTerm(id.toString());
                            tDocs.seek(aggregateIds);
                            while (tDocs.next()) {
                                Document doc = reader.document(
                                        tDocs.doc(), FieldSelectors.UUID);
                                NodeId nId = new NodeId(doc.get(FieldNames.UUID));
                                map.put(nId, (NodeState) ism.getItemState(nId));
                                found++;
                            }
                        }
View Full Code Here

            TermDocs tDocs = reader.termDocs(idTerm);
            int docNumber;
            Document doc;
            try {
                if (tDocs.next()) {
                    docNumber = tDocs.doc();
                    doc = reader.document(docNumber);
                } else {
                    // node not found in index
                    return null;
                }
View Full Code Here

                        NodeId childId = entry.getId();
                        Term uuidTerm = TermFactory.createUUIDTerm(childId.toString());
                        TermDocs docs = reader.termDocs(uuidTerm);
                        try {
                            if (docs.next()) {
                                childrenHits.set(docs.doc());
                            }
                        } finally {
                            docs.close();
                        }
                    }
View Full Code Here

                });

                TermDocs termDocs = reader.termDocs(new Term(FieldNames.PROPERTIES_SET, refProperty));
                String prefix = FieldNames.createNamedValue(refProperty, "");
                while (termDocs.next()) {
                    int doc = termDocs.doc();
                    
                    String[] values = reader.document(doc).getValues(FieldNames.PROPERTIES);
                    if (values == null) {
                        // no reference properties at all on this node
                        continue;
View Full Code Here

                            String uuid = values[v].substring(prefix.length());
                           
                            TermDocs node = reader.termDocs(TermFactory.createUUIDTerm(uuid));
                            try {
                                while (node.next()) {
                                    if (subQueryHits.get(node.doc())) {
                                        hits.set(doc);
                                    }
                                }
                            } finally {
                                node.close();
View Full Code Here

    public int getDoc(IndexReader reader) throws IOException {
        if (doc == -1) {
            TermDocs docs = reader.termDocs(TermFactory.createUUIDTerm(id.toString()));
            try {
                if (docs.next()) {
                    return docs.doc();
                } else {
                    throw new IOException("Node with id " + id + " not found in index");
                }
            } finally {
                docs.close();
View Full Code Here

        more.setMinWordLen(4);
        Query similarityQuery = null;
        TermDocs td = reader.termDocs(TermFactory.createUUIDTerm(uuid));
        try {
            if (td.next()) {
                similarityQuery = more.like(td.doc());
            }
        } finally {
            td.close();
        }
        if (similarityQuery != null) {
View Full Code Here

                while (terms.term() != null
                        && terms.term().field() == FieldNames.PROPERTIES
                        && terms.term().text().startsWith(field)) {
                    docs.seek(terms);
                    while (docs.next()) {
                        docFilter.set(docs.doc());
                    }
                    terms.next();
                }
            } finally {
                docs.close();
View Full Code Here

            // search through readers
            for (int i = 0; i < subReaders.length; i++) {
                TermDocs docs = subReaders[i].termDocs(term);
                try {
                    if (docs.next()) {
                        return new SingleTermDocs(docs.doc() + starts[i]);
                    }
                } finally {
                    docs.close();
                }
            }
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.