Search in sources :

Example 1 with LegacyNumericTermAttribute

use of org.apache.solr.legacy.LegacyNumericTokenStream.LegacyNumericTermAttribute in project lucene-solr by apache.

the class TestLegacyFieldReuse method assertNumericContents.

private void assertNumericContents(int value, TokenStream ts) throws IOException {
    assertTrue(ts instanceof LegacyNumericTokenStream);
    LegacyNumericTermAttribute numericAtt = ts.getAttribute(LegacyNumericTermAttribute.class);
    ts.reset();
    boolean seen = false;
    while (ts.incrementToken()) {
        if (numericAtt.getShift() == 0) {
            assertEquals(value, numericAtt.getRawValue());
            seen = true;
        }
    }
    ts.end();
    ts.close();
    assertTrue(seen);
}
Also used : LegacyNumericTermAttribute(org.apache.solr.legacy.LegacyNumericTokenStream.LegacyNumericTermAttribute) LegacyNumericTokenStream(org.apache.solr.legacy.LegacyNumericTokenStream)

Aggregations

LegacyNumericTokenStream (org.apache.solr.legacy.LegacyNumericTokenStream)1 LegacyNumericTermAttribute (org.apache.solr.legacy.LegacyNumericTokenStream.LegacyNumericTermAttribute)1