Package org.apache.lucene.facet.taxonomy

Examples of org.apache.lucene.facet.taxonomy.CategoryPath.clear()


    // be stored in the array
    p1.clear();
    p1.add("averylongcategoryname");
    p1.clear();
    p1.add("hi");
    p2.clear();
    p2.add("hi");
    assertEquals(p1.longHashCode(-1), p2.longHashCode(-1));
    // Being of the same length is obviously not enough to be equal
    p1.clear();
    p1.add("hi");
View Full Code Here


    p2.add("hi");
    assertEquals(p1.longHashCode(-1), p2.longHashCode(-1));
    // Being of the same length is obviously not enough to be equal
    p1.clear();
    p1.add("hi");
    p2.clear();
    p2.add("hello");
    assertEquals(false, p1.longHashCode(-1)==p2.longHashCode(-1));
    p1.clear();
    p1.add("hi");
    p2.clear();
View Full Code Here

    p2.clear();
    p2.add("hello");
    assertEquals(false, p1.longHashCode(-1)==p2.longHashCode(-1));
    p1.clear();
    p1.add("hi");
    p2.clear();
    p2.add("ho");
    assertEquals(false, p1.longHashCode(-1)==p2.longHashCode(-1));
   
    // Now move to testing prefixes:
    CategoryPath p = new CategoryPath();
View Full Code Here

        // hence documents), there are no deletions in the index. Therefore, it
        // is sufficient to call next(), and then doc(), exactly once with no
        // 'validation' checks.
        td.seek(t);
        td.next();
        cp.clear();
        cp.add(t.text(), delimiter);
        cache.put(cp, td.doc());
      } while (terms.next());
    }
View Full Code Here

        // If 'first' is before currentMain, or currentMain is null,
        // then 'first' is a new category and we need to add it to the
        // main taxonomy. Then for all taxonomies with this 'first'
        // category, we need to add the new category number to their
        // map, and move to the next category in all of them.
        cp.clear();
        cp.add(first, delimiter);
        // We can call internalAddCategory() instead of addCategory()
        // because we know the category hasn't been seen yet.
        int newordinal = internalAddCategory(cp, cp.length());
        // TODO (Facet): we already had this term in our hands before, in nextTE...
View Full Code Here

        // hence documents), there are no deletions in the index. Therefore, it
        // is sufficient to call next(), and then doc(), exactly once with no
        // 'validation' checks.
        td.seek(t);
        td.next();
        cp.clear();
        cp.add(t.text(), delimiter);
        cache.put(cp, td.doc());
      } while (terms.next());
    }
View Full Code Here

      TermDocs docs = r.termDocs();
      // we call next() first, to skip the root category which always exists.
      while (te.next()) {
        Term term = te.term();
        if (term.field() != Consts.FULL) break;
        cp.clear();
        cp.add(term.text(), Consts.DEFAULT_DELIMITER);
        final int ordinal = addCategory(cp);
        docs.seek(term);
        docs.next();
        ordinalMap.addMapping(docs.doc(), ordinal);
View Full Code Here

        // hence documents), there are no deletions in the index. Therefore, it
        // is sufficient to call next(), and then doc(), exactly once with no
        // 'validation' checks.
        td.seek(t);
        td.next();
        cp.clear();
        cp.add(t.text(), delimiter);
        cache.put(cp, td.doc());
      } while (terms.next());
    }
View Full Code Here

        // If 'first' is before currentMain, or currentMain is null,
        // then 'first' is a new category and we need to add it to the
        // main taxonomy. Then for all taxonomies with this 'first'
        // category, we need to add the new category number to their
        // map, and move to the next category in all of them.
        cp.clear();
        cp.add(first, delimiter);
        // We can call internalAddCategory() instead of addCategory()
        // because we know the category hasn't been seen yet.
        int newordinal = internalAddCategory(cp, cp.length());
        // TODO (Facet): we already had this term in our hands before, in nextTE...
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.