Package org.apache.lucene.index

Examples of org.apache.lucene.index.Term.createTerm()


      String[] contents  = {"a", "b", "c"};
      HashSet<Term> termsSet = new HashSet<Term>();
      for (int i = 0; i < contents.length; i++) {
        initIndex(random, dir1, i+10, i==0, contents[i]);
        initIndex(random, dir2, i+5, i==0, contents[i]);
        termsSet.add(template.createTerm(contents[i]));
      }
      IndexSearcher searcher1 = new IndexSearcher(dir1, true);
      IndexSearcher searcher2 = new IndexSearcher(dir2, true);
      MultiSearcher multiSearcher = getMultiSearcherInstance(new Searcher[]{searcher1, searcher2});
      Map<Term,Integer> docFrequencyMap = multiSearcher.createDocFrequencyMap(termsSet);
View Full Code Here


      IndexSearcher searcher2 = new IndexSearcher(dir2, true);
      MultiSearcher multiSearcher = getMultiSearcherInstance(new Searcher[]{searcher1, searcher2});
      Map<Term,Integer> docFrequencyMap = multiSearcher.createDocFrequencyMap(termsSet);
      assertEquals(3, docFrequencyMap.size());
      for (int i = 0; i < contents.length; i++) {
        assertEquals(Integer.valueOf((i*2) +15), docFrequencyMap.get(template.createTerm(contents[i])));
      }
      multiSearcher.close();
      searcher1.close();
      searcher2.close();
      dir1.close();
View Full Code Here

                    TermDocs tDocs = reader.termDocs();
                    try {
                        ItemStateManager ism = getContext().getItemStateManager();
                        for (NodeId id : removedIds) {
                            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));
View Full Code Here

               {
                  ItemDataConsumer ism = getContext().getItemStateManager();
                  for (Iterator<String> it = removedNodeIds.iterator(); it.hasNext();)
                  {
                     String id = it.next();
                     aggregateUUIDs = aggregateUUIDs.createTerm(id);
                     tDocs.seek(aggregateUUIDs);
                     while (tDocs.next())
                     {
                        Document doc = reader.document(tDocs.doc(), FieldSelectors.UUID);
                        String uuid = doc.get(FieldNames.UUID);
View Full Code Here

               {
                  ItemDataConsumer ism = getContext().getItemStateManager();
                  for (Iterator<String> it = removedNodeIds.iterator(); it.hasNext();)
                  {
                     String id = it.next();
                     aggregateUUIDs = aggregateUUIDs.createTerm(id);
                     tDocs.seek(aggregateUUIDs);
                     while (tDocs.next())
                     {
                        Document doc = reader.document(tDocs.doc(), FieldSelectors.UUID);
                        String uuid = doc.get(FieldNames.UUID);
View Full Code Here

                TermDocs tDocs = reader.termDocs();
                try {
                    ItemStateManager ism = getContext().getItemStateManager();
                    for (NodeId id : removedIds) {
                        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));
View Full Code Here

                    TermDocs tDocs = reader.termDocs();
                    try {
                        ItemStateManager ism = getContext().getItemStateManager();
                        for (Iterator it = removedNodeIds.iterator(); it.hasNext(); ) {
                            NodeId id = (NodeId) it.next();
                            aggregateUUIDs = aggregateUUIDs.createTerm(
                                    id.getUUID().toString());
                            tDocs.seek(aggregateUUIDs);
                            while (tDocs.next()) {
                                Document doc = reader.document(tDocs.doc(), FieldSelectors.UUID);
                                String uuid = doc.get(FieldNames.UUID);
View Full Code Here

                     {
                        ItemDataConsumer ism = getContext().getItemStateManager();
                        for (Iterator<String> it = removedNodeIds.iterator(); it.hasNext();)
                        {
                           String id = it.next();
                           aggregateUUIDs = aggregateUUIDs.createTerm(id);
                           tDocs.seek(aggregateUUIDs);
                           while (tDocs.next())
                           {
                              Document doc = reader.document(tDocs.doc(), FieldSelectors.UUID);
                              String uuid = doc.get(FieldNames.UUID);
View Full Code Here

                     {
                        ItemDataConsumer ism = getContext().getItemStateManager();
                        for (Iterator<String> it = removedNodeIds.iterator(); it.hasNext();)
                        {
                           String id = it.next();
                           aggregateUUIDs = aggregateUUIDs.createTerm(id);
                           tDocs.seek(aggregateUUIDs);
                           while (tDocs.next())
                           {
                              Document doc = reader.document(tDocs.doc(), FieldSelectors.UUID);
                              String uuid = doc.get(FieldNames.UUID);
View Full Code Here

   
    final Term term = new Term(fieldName);
    // iterate through each boxid
    for (int i =0; i< sz; i++) {
      double boxId = area.get(i).doubleValue();
      termDocs.seek(term.createTerm(NumericUtils.doubleToPrefixCoded(boxId)));
      // iterate through all documents
      // which have this boxId
      while (termDocs.next()) {
        bits.set(termDocs.doc());
      }
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.