Package org.apache.lucene.document

Examples of org.apache.lucene.document.StringField.tokenStream()


 
  public void testStringField() throws IOException {
    StringField stringField = new StringField("foo", "bar", Field.Store.NO);
   
    // passing null
    TokenStream ts = stringField.tokenStream(null, null);
    assertTokenStreamContents(ts,
        new String[] { "bar" },
        new int[]    { 0 },
        new int[]    { 3 }
    );
View Full Code Here


        new int[]    { 3 }
    );
   
    // now reuse previous stream
    stringField = new StringField("foo", "baz", Field.Store.NO);
    TokenStream ts2 = stringField.tokenStream(null, ts);
    assertSame(ts, ts);
    assertTokenStreamContents(ts,
        new String[] { "baz" },
        new int[]    { 0 },
        new int[]    { 3 }
View Full Code Here

    );
   
    // pass a bogus stream and ensure its still ok
    stringField = new StringField("foo", "beer", Field.Store.NO);
    TokenStream bogus = new NumericTokenStream();
    ts = stringField.tokenStream(null, bogus);
    assertNotSame(ts, bogus);
    assertTokenStreamContents(ts,
        new String[] { "beer" },
        new int[]    { 0 },
        new int[]    { 4 }
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.