Package org.apache.lucene.index

Examples of org.apache.lucene.index.FilteredTermsEnum


   *          the terms enum to filter
   * @return a filtered {@link TermsEnum} that only returns prefix coded 64 bit
   *         terms with a shift value of <tt>0</tt>.
   */
  public static TermsEnum filterPrefixCodedLongs(TermsEnum termsEnum) {
    return new FilteredTermsEnum(termsEnum, false) {
      @Override
      protected AcceptStatus accept(BytesRef term) {
        return NumericUtils.getPrefixCodedLongShift(term) == 0 ? AcceptStatus.YES : AcceptStatus.END;
      }
    };
View Full Code Here


   *          the terms enum to filter
   * @return a filtered {@link TermsEnum} that only returns prefix coded 32 bit
   *         terms with a shift value of <tt>0</tt>.
   */
  public static TermsEnum filterPrefixCodedInts(TermsEnum termsEnum) {
    return new FilteredTermsEnum(termsEnum, false) {
     
      @Override
      protected AcceptStatus accept(BytesRef term) {
        return NumericUtils.getPrefixCodedIntShift(term) == 0 ? AcceptStatus.YES : AcceptStatus.END;
      }
View Full Code Here

   *          the terms enum to filter
   * @return a filtered {@link TermsEnum} that only returns prefix coded 64 bit
   *         terms with a shift value of <tt>0</tt>.
   */
  public static TermsEnum filterPrefixCodedLongs(TermsEnum termsEnum) {
    return new FilteredTermsEnum(termsEnum, false) {
      @Override
      protected AcceptStatus accept(BytesRef term) {
        return NumericUtils.getPrefixCodedLongShift(term) == 0 ? AcceptStatus.YES : AcceptStatus.END;
      }
    };
View Full Code Here

   *          the terms enum to filter
   * @return a filtered {@link TermsEnum} that only returns prefix coded 32 bit
   *         terms with a shift value of <tt>0</tt>.
   */
  public static TermsEnum filterPrefixCodedInts(TermsEnum termsEnum) {
    return new FilteredTermsEnum(termsEnum, false) {
     
      @Override
      protected AcceptStatus accept(BytesRef term) {
        return NumericUtils.getPrefixCodedIntShift(term) == 0 ? AcceptStatus.YES : AcceptStatus.END;
      }
View Full Code Here

     * A {@link TermsEnum} that iterates only full precision prefix coded 64 bit values.
     *
     * @see #buildFromTerms(TermsEnum, Bits)
     */
    public static TermsEnum wrapNumeric64Bit(TermsEnum termsEnum) {
        return new FilteredTermsEnum(termsEnum, false) {
            @Override
            protected AcceptStatus accept(BytesRef term) throws IOException {
                // we stop accepting terms once we moved across the prefix codec terms - redundant values!
                return NumericUtils.getPrefixCodedLongShift(term) == 0 ? AcceptStatus.YES : AcceptStatus.END;
            }
View Full Code Here

     * A {@link TermsEnum} that iterates only full precision prefix coded 32 bit values.
     *
     * @see #buildFromTerms(TermsEnum, Bits)
     */
    public static TermsEnum wrapNumeric32Bit(TermsEnum termsEnum) {
        return new FilteredTermsEnum(termsEnum, false) {

            @Override
            protected AcceptStatus accept(BytesRef term) throws IOException {
                // we stop accepting terms once we moved across the prefix codec terms - redundant values!
                return NumericUtils.getPrefixCodedIntShift(term) == 0 ? AcceptStatus.YES : AcceptStatus.END;
View Full Code Here

TOP

Related Classes of org.apache.lucene.index.FilteredTermsEnum

Copyright © 2018 www.massapicom. 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.