@Override public TokenStream create(TokenStream tokenStream) { CommonGramsFilter filter = new CommonGramsFilter(tokenStream, words); if (queryMode) { return new CommonGramsQueryFilter(filter); } else { return filter; } }
/** * Create a CommonGramsFilter and wrap it with a CommonGramsQueryFilter */ @Override public CommonGramsQueryFilter create(TokenStream input) { CommonGramsFilter commonGrams = new CommonGramsFilter(luceneMatchVersion, input, commonWords); CommonGramsQueryFilter commonGramsQuery = new CommonGramsQueryFilter( commonGrams); return commonGramsQuery; }
/** * Create a CommonGramsFilter and wrap it with a CommonGramsQueryFilter */ @Override public TokenFilter create(TokenStream input) { CommonGramsFilter commonGrams = (CommonGramsFilter) super.create(input); return new CommonGramsQueryFilter(commonGrams); }