Java 类org.apache.lucene.index.FilteredTermsEnum 实例源码

项目:elasticsearch_my    文件:OrdinalsBuilder.java   
/**
 * A {@link TermsEnum} that iterates only highest resolution geo prefix coded terms.
 *
 * @see #buildFromTerms(TermsEnum)
 */
public static TermsEnum wrapGeoPointTerms(TermsEnum termsEnum) {
    return new FilteredTermsEnum(termsEnum, false) {
        @Override
        protected AcceptStatus accept(BytesRef term) throws IOException {
            // accept only the max resolution terms
            // todo is this necessary?
            return GeoPointField.getPrefixCodedShift(term) == GeoPointField.PRECISION_STEP * 4 ?
                AcceptStatus.YES : AcceptStatus.END;
        }
    };
}
项目:elasticsearch_my    文件:OrdinalsBuilder.java   
/**
 * A {@link TermsEnum} that iterates only full precision prefix coded 64 bit values.
 *
 * @see #buildFromTerms(TermsEnum)
 */
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 LegacyNumericUtils.getPrefixCodedLongShift(term) == 0 ? AcceptStatus.YES : AcceptStatus.END;
        }
    };
}
项目:elasticsearch_my    文件:OrdinalsBuilder.java   
/**
 * A {@link TermsEnum} that iterates only full precision prefix coded 32 bit values.
 *
 * @see #buildFromTerms(TermsEnum)
 */
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 LegacyNumericUtils.getPrefixCodedIntShift(term) == 0 ? AcceptStatus.YES : AcceptStatus.END;
        }
    };
}
项目:Elasticsearch    文件:OrdinalsBuilder.java   
/**
 * A {@link TermsEnum} that iterates only highest resolution geo prefix coded terms.
 *
 * @see #buildFromTerms(TermsEnum)
 */
public static TermsEnum wrapGeoPointTerms(TermsEnum termsEnum) {
    return new FilteredTermsEnum(termsEnum, false) {
        @Override
        protected AcceptStatus accept(BytesRef term) throws IOException {
            // accept only the max resolution terms
            // todo is this necessary?
            return GeoEncodingUtils.getPrefixCodedShift(term) == GeoPointField.PRECISION_STEP * 4 ?
                AcceptStatus.YES : AcceptStatus.END;
        }
    };
}
项目:Elasticsearch    文件:OrdinalsBuilder.java   
/**
 * A {@link TermsEnum} that iterates only full precision prefix coded 64 bit values.
 *
 * @see #buildFromTerms(TermsEnum)
 */
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;
        }
    };
}
项目:Elasticsearch    文件:OrdinalsBuilder.java   
/**
 * A {@link TermsEnum} that iterates only full precision prefix coded 32 bit values.
 *
 * @see #buildFromTerms(TermsEnum)
 */
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;
        }
    };
}
项目:NYBC    文件:NumericUtils.java   
/**
 * Filters the given {@link TermsEnum} by accepting only prefix coded 32 bit
 * terms with a shift value of <tt>0</tt>.
 * 
 * @param termsEnum
 *          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;
    }
  };
}
项目:read-open-source-code    文件:NumericUtils.java   
/**
 * Filters the given {@link TermsEnum} by accepting only prefix coded 32 bit
 * terms with a shift value of <tt>0</tt>.
 * 
 * @param termsEnum
 *          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;
    }
  };
}
项目:read-open-source-code    文件:NumericUtils.java   
/**
 * Filters the given {@link TermsEnum} by accepting only prefix coded 32 bit
 * terms with a shift value of <tt>0</tt>.
 * 
 * @param termsEnum
 *          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;
    }
  };
}
项目:Maskana-Gestor-de-Conocimiento    文件:NumericUtils.java   
/**
 * Filters the given {@link TermsEnum} by accepting only prefix coded 32 bit
 * terms with a shift value of <tt>0</tt>.
 * 
 * @param termsEnum
 *          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;
    }
  };
}
项目:search    文件:RegexQuery.java   
@Override
protected FilteredTermsEnum getTermsEnum(Terms terms, AttributeSource atts) throws IOException {
  return new RegexTermsEnum(terms.iterator(null), term, regexImpl);
}
项目:NYBC    文件:RegexQuery.java   
@Override
protected FilteredTermsEnum getTermsEnum(Terms terms, AttributeSource atts) throws IOException {
  return new RegexTermsEnum(terms.iterator(null), term, regexImpl);
}
项目:read-open-source-code    文件:RegexQuery.java   
@Override
protected FilteredTermsEnum getTermsEnum(Terms terms, AttributeSource atts) throws IOException {
  return new RegexTermsEnum(terms.iterator(null), term, regexImpl);
}
项目:read-open-source-code    文件:RegexQuery.java   
@Override
protected FilteredTermsEnum getTermsEnum(Terms terms, AttributeSource atts) throws IOException {
  return new RegexTermsEnum(terms.iterator(null), term, regexImpl);
}
项目:read-open-source-code    文件:RegexQuery.java   
@Override
protected FilteredTermsEnum getTermsEnum(Terms terms, AttributeSource atts) throws IOException {
  return new RegexTermsEnum(terms.iterator(null), term, regexImpl);
}
项目:Maskana-Gestor-de-Conocimiento    文件:RegexQuery.java   
@Override
protected FilteredTermsEnum getTermsEnum(Terms terms, AttributeSource atts) throws IOException {
  return new RegexTermsEnum(terms.iterator(null), term, regexImpl);
}
项目:NYBC    文件:NumericUtils.java   
/**
 * Filters the given {@link TermsEnum} by accepting only prefix coded 64 bit
 * terms with a shift value of <tt>0</tt>.
 * 
 * @param termsEnum
 *          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;
    }
  };
}
项目:read-open-source-code    文件:NumericUtils.java   
/**
 * Filters the given {@link TermsEnum} by accepting only prefix coded 64 bit
 * terms with a shift value of <tt>0</tt>.
 * 
 * @param termsEnum
 *          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;
    }
  };
}
项目:read-open-source-code    文件:NumericUtils.java   
/**
 * Filters the given {@link TermsEnum} by accepting only prefix coded 64 bit
 * terms with a shift value of <tt>0</tt>.
 * 
 * @param termsEnum
 *          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;
    }
  };
}
项目:Maskana-Gestor-de-Conocimiento    文件:NumericUtils.java   
/**
 * Filters the given {@link TermsEnum} by accepting only prefix coded 64 bit
 * terms with a shift value of <tt>0</tt>.
 * 
 * @param termsEnum
 *          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;
    }
  };
}