Package org.apache.lucene.analysis.payloads

Examples of org.apache.lucene.analysis.payloads.DelimitedPayloadTokenFilter.reset()


    ResourceLoader loader = new StringMockResourceLoader("solr/collection1");
    factory.inform(loader);

    TokenStream input = new MockTokenizer(new StringReader("the|0.1 quick|0.1 red|0.1"), MockTokenizer.WHITESPACE, false);
    DelimitedPayloadTokenFilter tf = factory.create(input);
    tf.reset();
    while (tf.incrementToken()){
      PayloadAttribute payAttr = tf.getAttribute(PayloadAttribute.class);
      assertTrue("payAttr is null and it shouldn't be", payAttr != null);
      byte[] payData = payAttr.getPayload().bytes;
      assertTrue("payData is null and it shouldn't be", payData != null);
View Full Code Here


    ResourceLoader loader = new StringMockResourceLoader("solr/collection1");
    factory.inform(loader);

    TokenStream input = new MockTokenizer(new StringReader("the*0.1 quick*0.1 red*0.1"), MockTokenizer.WHITESPACE, false);
    DelimitedPayloadTokenFilter tf = factory.create(input);
    tf.reset();
    while (tf.incrementToken()){
      PayloadAttribute payAttr = tf.getAttribute(PayloadAttribute.class);
      assertTrue("payAttr is null and it shouldn't be", payAttr != null);
      byte[] payData = payAttr.getPayload().bytes;
      assertTrue("payData is null and it shouldn't be", payData != null);
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.