Examples of terms()


Examples of com.asakusafw.vocabulary.model.Joined.terms()

        Joined annotation = loader.modelType("Simple").getAnnotation(Joined.class);
        assertThat(annotation, not(nullValue()));

        assertThat(annotation.terms().length, is(2));

        Joined.Term a = annotation.terms()[0];
        assertThat(a.source(), eq(loader.modelType("A")));
        assertThat(a.mappings().length, is(2));
        assertThat(a.mappings(), hasItemInArray(mapping("sid", "key")));
        assertThat(a.mappings(), hasItemInArray(mapping("value", "aValue")));
        assertThat(a.shuffle(), is(grouping("sid")));
View Full Code Here

Examples of com.asakusafw.vocabulary.model.Joined.terms()

        assertThat(a.mappings().length, is(2));
        assertThat(a.mappings(), hasItemInArray(mapping("sid", "key")));
        assertThat(a.mappings(), hasItemInArray(mapping("value", "aValue")));
        assertThat(a.shuffle(), is(grouping("sid")));

        Joined.Term b = annotation.terms()[1];
        assertThat(b.source(), eq(loader.modelType("B")));
        assertThat(b.mappings().length, is(2));
        assertThat(b.mappings(), hasItemInArray(mapping("sid", "key")));
        assertThat(b.mappings(), hasItemInArray(mapping("value", "bValue")));
        assertThat(b.shuffle(), is(grouping("sid")));
View Full Code Here

Examples of com.asakusafw.vocabulary.model.Joined.terms()

        assertThat(object.get("right"), eq(new Text("Hello, right!")));

        Joined annotation = object.unwrap().getClass().getAnnotation(Joined.class);
        assertThat(annotation, not(nullValue()));

        assertThat(annotation.terms().length, is(2));

        loader.setNamespace(Constants.SOURCE_TABLE);
        Joined.Term a = annotation.terms()[0];
        assertThat(a.source(), eq(loader.modelType("Left")));
        assertThat(a.mappings().length, is(2));
View Full Code Here

Examples of com.asakusafw.vocabulary.model.Joined.terms()

        assertThat(annotation, not(nullValue()));

        assertThat(annotation.terms().length, is(2));

        loader.setNamespace(Constants.SOURCE_TABLE);
        Joined.Term a = annotation.terms()[0];
        assertThat(a.source(), eq(loader.modelType("Left")));
        assertThat(a.mappings().length, is(2));
        assertThat(a.mappings(), hasItemInArray(mapping("rightId", "id")));
        assertThat(a.mappings(), hasItemInArray(mapping("value", "left")));
        assertThat(a.shuffle(), is(grouping("rightId")));
View Full Code Here

Examples of com.asakusafw.vocabulary.model.Joined.terms()

        assertThat(a.mappings().length, is(2));
        assertThat(a.mappings(), hasItemInArray(mapping("rightId", "id")));
        assertThat(a.mappings(), hasItemInArray(mapping("value", "left")));
        assertThat(a.shuffle(), is(grouping("rightId")));

        Joined.Term b = annotation.terms()[1];
        assertThat(b.source(), eq(loader.modelType("Right")));
        assertThat(b.mappings().length, is(2));
        assertThat(b.mappings(), hasItemInArray(mapping("sid", "id")));
        assertThat(b.mappings(), hasItemInArray(mapping("value", "right")));
        assertThat(b.shuffle(), is(grouping("sid")));
View Full Code Here

Examples of org.apache.blur.thrift.generated.Blur.Iface.terms()

      IOException {
    Iface client = BlurClient.getClient(connectionStr);
    String[] split = field.split("\\.");
    String columnFamily = split[0];
    String columnName = split[1];
    List<String> terms = client.terms(tableName, columnFamily, columnName, "", (short) numberOfTerms);
    return new HashSet<String>(terms);
  }

  private static Set<String> getFields(String connectionStr, final String tableName) throws BlurException, TException, IOException {
    Iface client = BlurClient.getClient(connectionStr);
View Full Code Here

Examples of org.apache.lucene.codecs.FieldsProducer.terms()

    final FieldsProducer reader = codec.postingsFormat().fieldsProducer(new SegmentReadState(dir, si, fieldInfos, newIOContext(random()), DirectoryReader.DEFAULT_TERMS_INDEX_DIVISOR));

    final Iterator<String> fieldsEnum = reader.iterator();
    String fieldName = fieldsEnum.next();
    assertNotNull(fieldName);
    final Terms terms2 = reader.terms(fieldName);
    assertNotNull(terms2);

    final TermsEnum termsEnum = terms2.iterator(null);

    DocsEnum docsEnum = null;
View Full Code Here

Examples of org.apache.lucene.index.AtomicReader.terms()

    RandomIndexWriter w = new RandomIndexWriter(random(), dir);
    createRandomIndex(atLeast(50), w, random().nextLong());
    DirectoryReader reader = w.getReader();
    AtomicReader wrapper = SlowCompositeReaderWrapper.wrap(reader);
    String field = "body";
    Terms terms = wrapper.terms(field);
    PriorityQueue<TermAndFreq> lowFreqQueue = new PriorityQueue<CommonTermsQueryTest.TermAndFreq>(
        5) {
     
      @Override
      protected boolean lessThan(TermAndFreq a, TermAndFreq b) {
View Full Code Here

Examples of org.apache.lucene.index.AtomicReader.terms()

      int base = 0;
      TermsEnum te = null;
      DocsEnum docs = null;
      for (final AtomicReaderContext ctx : r.leaves()) {
        final AtomicReader ar = ctx.reader();
        final Terms terms = ar.terms(Consts.FULL);
        te = terms.iterator(te);
        while (te.next() != null) {
          String value = te.term().utf8ToString();
          CategoryPath cp = new CategoryPath(value, delimiter);
          final int ordinal = addCategory(cp);
View Full Code Here

Examples of org.apache.lucene.index.AtomicReader.terms()

      assert !terms.isEmpty();
      final AtomicReader reader = context.reader();
      final Bits liveDocs = acceptDocs;
      final PostingsAndPosition[] postings = new PostingsAndPosition[terms.size()];

      final Terms fieldTerms = reader.terms(field);
      if (fieldTerms == null) {
        return null;
      }

      // Reuse single TermsEnum below:
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.