public class DelegatingSearchPredicateFactory extends Object implements SearchPredicateFactory
SearchPredicateFactory.
Mainly useful when implementing a SearchPredicateFactoryExtension.
| Constructor and Description |
|---|
DelegatingSearchPredicateFactory(SearchPredicateFactory delegate) |
| Modifier and Type | Method and Description |
|---|---|
BooleanPredicateClausesStep<?> |
bool()
Match documents if they match a combination of boolean clauses.
|
PredicateFinalStep |
bool(Consumer<? super BooleanPredicateClausesStep<?>> clauseContributor)
Match documents if they match a combination of boolean clauses,
which will be defined by the given consumer.
|
ExistsPredicateFieldStep<?> |
exists()
Match documents where a given field exists.
|
SearchPredicateFactoryExtensionIfSupportedStep |
extension()
Create a DSL step allowing multiple attempts to apply extensions one after the other,
failing only if none of the extensions is supported.
|
<T> T |
extension(SearchPredicateFactoryExtension<T> extension)
Extend the current factory with the given extension,
resulting in an extended factory offering different types of predicates.
|
protected SearchPredicateFactory |
getDelegate() |
MatchIdPredicateMatchingStep<?> |
id()
Match documents where the identifier is among the given values.
|
MatchPredicateFieldStep<?> |
match()
Match documents where targeted fields have a value that "matches" a given single value.
|
MatchAllPredicateOptionsStep<?> |
matchAll()
Match all documents.
|
NestedPredicateFieldStep<?> |
nested()
Match documents where a
nested object
matches a given predicate. |
PhrasePredicateFieldStep<?> |
phrase()
Match documents where targeted fields have a value that contains a given phrase.
|
RangePredicateFieldStep<?> |
range()
Match documents where targeted fields have a value within lower and upper bounds.
|
SimpleQueryStringPredicateFieldStep<?> |
simpleQueryString()
Match documents according to a given query string,
with a simple query language adapted to end users.
|
SpatialPredicateInitialStep |
spatial()
Access the different types of spatial predicates.
|
WildcardPredicateFieldStep<?> |
wildcard()
Match documents where targeted fields contain a term that matches a given pattern,
such as
inter*on or pa?t. |
public DelegatingSearchPredicateFactory(SearchPredicateFactory delegate)
public MatchAllPredicateOptionsStep<?> matchAll()
SearchPredicateFactorymatchAll in interface SearchPredicateFactoryMatchAllPredicateOptionsSteppublic MatchIdPredicateMatchingStep<?> id()
SearchPredicateFactoryid in interface SearchPredicateFactoryMatchIdPredicateMatchingSteppublic BooleanPredicateClausesStep<?> bool()
SearchPredicateFactorybool in interface SearchPredicateFactoryBooleanPredicateClausesSteppublic PredicateFinalStep bool(Consumer<? super BooleanPredicateClausesStep<?>> clauseContributor)
SearchPredicateFactoryBest used with lambda expressions.
bool in interface SearchPredicateFactoryclauseContributor - A consumer that will add clauses to the step passed in parameter.
Should generally be a lambda expression.BooleanPredicateClausesSteppublic MatchPredicateFieldStep<?> match()
SearchPredicateFactoryNote that "value matching" may be exact or approximate depending on the type of the targeted fields: numeric fields in particular imply exact matches, while analyzed, full-text fields imply approximate matches depending on how they are analyzed.
match in interface SearchPredicateFactoryMatchPredicateFieldSteppublic RangePredicateFieldStep<?> range()
SearchPredicateFactoryrange in interface SearchPredicateFactoryRangePredicateFieldSteppublic PhrasePredicateFieldStep<?> phrase()
SearchPredicateFactoryphrase in interface SearchPredicateFactoryPhrasePredicateFieldSteppublic WildcardPredicateFieldStep<?> wildcard()
SearchPredicateFactoryinter*on or pa?t.
Note that such patterns are not analyzed, thus any character that is not a wildcard must match exactly the content of the index (including uppercase letters, diacritics, ...).
wildcard in interface SearchPredicateFactoryWildcardPredicateFieldSteppublic NestedPredicateFieldStep<?> nested()
SearchPredicateFactorynested object
matches a given predicate.nested in interface SearchPredicateFactoryNestedPredicateFieldSteppublic SimpleQueryStringPredicateFieldStep<?> simpleQueryString()
SearchPredicateFactory
Note that by default, unless the query string contains explicit operators,
documents will match if any term mentioned in the query string is present in the document (OR operator).
This makes sense when sorting results by relevance, but is not ideal otherwise.
See SimpleQueryStringPredicateOptionsStep.defaultOperator(BooleanOperator) to change this behavior.
simpleQueryString in interface SearchPredicateFactorySimpleQueryStringPredicateFieldSteppublic ExistsPredicateFieldStep<?> exists()
SearchPredicateFactoryFields are considered to exist in a document when they have at least one non-null value in this document.
exists in interface SearchPredicateFactoryExistsPredicateFieldSteppublic SpatialPredicateInitialStep spatial()
SearchPredicateFactoryspatial in interface SearchPredicateFactorySpatialPredicateInitialSteppublic <T> T extension(SearchPredicateFactoryExtension<T> extension)
SearchPredicateFactoryextension in interface SearchPredicateFactoryT - The type of factory provided by the extension.extension - The extension to the predicate DSL.public SearchPredicateFactoryExtensionIfSupportedStep extension()
SearchPredicateFactory
If you only need to apply a single extension and fail if it is not supported,
use the simpler SearchPredicateFactory.extension(SearchPredicateFactoryExtension) method instead.
extension in interface SearchPredicateFactoryprotected SearchPredicateFactory getDelegate()
Copyright © 2006-2019 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.