Package org.apache.lucene.index

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


          LOG.info(" Processed " + processedRecords + " records (" +
                  (float)(LOG_STEP * 1000)/(float)(System.currentTimeMillis() - delta) + " rec/s)");
          delta = System.currentTimeMillis();
        }
        // Enumerate all docs with the same URL hash or content hash
        TermDocs td = ir.termDocs(t);
        if (td == null) continue;
        if (t.field().equals("uh")) {
          // Keep only the latest version of the document with
          // the same url hash. Note: even if the content
          // hash is identical, other metadata may be different, so even
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

    IndexReader reader = workspace.getIndexReader( provider, entity );
    TermDocs termDocs = null;
    try {
      //TODO is there a faster way?
      //TODO include TermDocs into the workspace?
      termDocs = reader.termDocs( term );
      String entityName = entity.getName();
      while ( termDocs.next() ) {
        int docIndex = termDocs.doc();
        if ( entityName.equals( reader.document( docIndex ).get( DocumentBuilder.CLASS_FIELDNAME ) ) ) {
          //remove only the one of the right class
View Full Code Here

    reader = IndexReader.open( new File( getBaseIndexDir(), "Animal.1" ) );
    try {
      int num = reader.numDocs();
      assertEquals( 1, num );
      TermDocs docs = reader.termDocs( new Term( "name", "mouse" ) );
      assertTrue( docs.next() );
      org.apache.lucene.document.Document doc = reader.document( docs.doc() );
      assertFalse( docs.next() );
    }
    finally {
View Full Code Here

        Term term = terms.term();
        docList.term = term.text();
        if (contain(searchable, term.field())) {
          RemoteOneNodeList oneNodeList = new RemoteOneNodeList();
          oneNodeList.nodeid = nodeid;
          TermDocs docs = indexReader.termDocs(term);
          while (docs.next()) {
            int docid = docs.doc();
            RemoteDoc doc = new RemoteDoc(docid, docs.freq());
            oneNodeList.add(doc);
          }
View Full Code Here

    boolean reindexItem = false;
    boolean inIndex = false;
   
    IndexReader ir = DSQuery.getIndexReader();
   
    TermDocs docs = ir.termDocs(t);
           
    while(docs.next())
    {
      inIndex = true;
      int id = docs.doc();
View Full Code Here

            throws IOException {
        IndexReader reader = index.getIndexReader();
        try {
            checkRewritten(reader);
            Term idTerm = new Term(FieldNames.UUID, id);
            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.getUUID().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

    s.close();
    IndexReader reader = IndexReader.open( new File( getBaseIndexDir(), "Documents" ) );
    try {
      int num = reader.numDocs();
      assertEquals( 1, num );
      TermDocs docs = reader.termDocs( new Term( "Abstract", "Hibernate" ) );
      org.apache.lucene.document.Document doc = reader.document( docs.doc() );
      assertFalse( docs.next() );
      docs = reader.termDocs( new Term( "Title", "Action" ) );
      doc = reader.document( docs.doc() );
      assertFalse( docs.next() );
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.