Java 类org.apache.lucene.search.FieldValueFilter 实例源码

项目:search    文件:CurrencyField.java   
public Query getRangeQuery(QParser parser, SchemaField field, final CurrencyValue p1, final CurrencyValue p2, final boolean minInclusive, final boolean maxInclusive) {
  String currencyCode = (p1 != null) ? p1.getCurrencyCode() :
                        (p2 != null) ? p2.getCurrencyCode() : defaultCurrency;

  // ValueSourceRangeFilter doesn't check exists(), so we have to
  final Filter docsWithValues = new FieldValueFilter(getAmountField(field).getName());
  final Filter vsRangeFilter = new ValueSourceRangeFilter
    (new RawCurrencyValueSource(field, currencyCode, parser),
     p1 == null ? null : p1.getAmount() + "", 
     p2 == null ? null : p2.getAmount() + "",
     minInclusive, maxInclusive);
  final Filter docsInRange = new ChainedFilter
    (new Filter [] { docsWithValues, vsRangeFilter }, ChainedFilter.AND);

  return new SolrConstantScoreQuery(docsInRange);

}
项目:NYBC    文件:CurrencyField.java   
public Query getRangeQuery(QParser parser, SchemaField field, final CurrencyValue p1, final CurrencyValue p2, final boolean minInclusive, final boolean maxInclusive) {
  String currencyCode = (p1 != null) ? p1.getCurrencyCode() :
                        (p2 != null) ? p2.getCurrencyCode() : defaultCurrency;

  // ValueSourceRangeFilter doesn't check exists(), so we have to
  final Filter docsWithValues = new FieldValueFilter(getAmountField(field).getName());
  final Filter vsRangeFilter = new ValueSourceRangeFilter
    (new RawCurrencyValueSource(field, currencyCode, parser),
     p1 == null ? null : p1.getAmount() + "", 
     p2 == null ? null : p2.getAmount() + "",
     minInclusive, maxInclusive);
  final Filter docsInRange = new ChainedFilter
    (new Filter [] { docsWithValues, vsRangeFilter }, ChainedFilter.AND);

  return new SolrConstantScoreQuery(docsInRange);

}
项目:search-core    文件:CurrencyField.java   
public Query getRangeQuery(QParser parser, SchemaField field, final CurrencyValue p1, final CurrencyValue p2, final boolean minInclusive, final boolean maxInclusive) {
  String currencyCode = (p1 != null) ? p1.getCurrencyCode() :
                        (p2 != null) ? p2.getCurrencyCode() : defaultCurrency;

  // ValueSourceRangeFilter doesn't check exists(), so we have to
  final Filter docsWithValues = new FieldValueFilter(getAmountField(field).getName());
  final Filter vsRangeFilter = new ValueSourceRangeFilter
    (new RawCurrencyValueSource(field, currencyCode, parser),
     p1 == null ? null : p1.getAmount() + "", 
     p2 == null ? null : p2.getAmount() + "",
     minInclusive, maxInclusive);
  final Filter docsInRange = new ChainedFilter
    (new Filter [] { docsWithValues, vsRangeFilter }, ChainedFilter.AND);

  return new SolrConstantScoreQuery(docsInRange);

}
项目:read-open-source-code    文件:CurrencyField.java   
public Query getRangeQuery(QParser parser, SchemaField field, final CurrencyValue p1, final CurrencyValue p2, final boolean minInclusive, final boolean maxInclusive) {
  String currencyCode = (p1 != null) ? p1.getCurrencyCode() :
                        (p2 != null) ? p2.getCurrencyCode() : defaultCurrency;

  // ValueSourceRangeFilter doesn't check exists(), so we have to
  final Filter docsWithValues = new FieldValueFilter(getAmountField(field).getName());
  final Filter vsRangeFilter = new ValueSourceRangeFilter
    (new RawCurrencyValueSource(field, currencyCode, parser),
     p1 == null ? null : p1.getAmount() + "", 
     p2 == null ? null : p2.getAmount() + "",
     minInclusive, maxInclusive);
  final Filter docsInRange = new ChainedFilter
    (new Filter [] { docsWithValues, vsRangeFilter }, ChainedFilter.AND);

  return new SolrConstantScoreQuery(docsInRange);

}
项目:read-open-source-code    文件:CurrencyField.java   
public Query getRangeQuery(QParser parser, SchemaField field, final CurrencyValue p1, final CurrencyValue p2, final boolean minInclusive, final boolean maxInclusive) {
  String currencyCode = (p1 != null) ? p1.getCurrencyCode() :
                        (p2 != null) ? p2.getCurrencyCode() : defaultCurrency;

  // ValueSourceRangeFilter doesn't check exists(), so we have to
  final Filter docsWithValues = new FieldValueFilter(getAmountField(field).getName());
  final Filter vsRangeFilter = new ValueSourceRangeFilter
    (new RawCurrencyValueSource(field, currencyCode, parser),
     p1 == null ? null : p1.getAmount() + "", 
     p2 == null ? null : p2.getAmount() + "",
     minInclusive, maxInclusive);
  final Filter docsInRange = new ChainedFilter
    (new Filter [] { docsWithValues, vsRangeFilter }, ChainedFilter.AND);

  return new SolrConstantScoreQuery(docsInRange);

}
项目:dremio-oss    文件:LuceneQueryConverter.java   
private Query toDoesNotExistQuery(SearchQuery.Exists exists) {
  return new FieldValueFilter(exists.getField(), true);
}