Class Indexer<T>
java.lang.Object
jadex.providedservice.impl.search.Indexer<T>
Indexer for values.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
Include null values during indexing.The index of published values.static final int
Cutoff value for building index set intersections.protected IKeyExtractor
<T> Service key extractor.All values. -
Constructor Summary
ConstructorsConstructorDescriptionIndexer
(IKeyExtractor<T> keyextractor, boolean includenull, String... indextypes) Create a new ServiceIndexer. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a value to the indexer.void
clear()
Clears all contained values.Returns all values.Gets the key extractor used by the service.Get values per type.Get values per specification.getValuesInverted
(List<jadex.common.Tuple2<String, String[]>> spec) Get values per specification (multivalues considered as OR match, when queries are the values).boolean
Test if a property is indexed per name.boolean
Tests if the search specification matches a value (spec=query).boolean
Tests if the search specification matches a value (spec=service, value=query).void
removeValue
(T value) Remove a value from the indexer.void
updateIndex
(String indexname) Update an index for all values.
-
Field Details
-
INTERSECT_CUTOFF
public static final int INTERSECT_CUTOFFCutoff value for building index set intersections.- See Also:
-
keyextractor
Service key extractor. -
values
All values. -
indexedvalues
The index of published values. First string is the index key name. -
includenull
protected boolean includenullInclude null values during indexing.
-
-
Constructor Details
-
Indexer
Create a new ServiceIndexer.
-
-
Method Details
-
isIndexed
Test if a property is indexed per name.- Parameters:
indexname
- The index name.- Returns:
- True, if is indexed.
-
getValues
public jadex.common.Tuple2<Set<T>,Object> getValues(List<jadex.common.Tuple3<String, String[], Boolean>> spec) Get values per specification. 'And' relates to inter-term, i.e. example type=ICMS, tags=a,b means an object must have both fulfilled. For multi-valued intra-term values it can be 'and' or 'or' as well.- Parameters:
spec
- The key values (first element is key name and array are values)- Returns:
- The values matching the spec.
-
getValuesInverted
Get values per specification (multivalues considered as OR match, when queries are the values).- Parameters:
spec
- The key values (first element is key name and array are values)- Returns:
- The values matching the spec.
-
getValues
Get values per type.- Parameters:
keytype
- the key type.key
- The key value.- Returns:
- The values matching the key.
-
getAllValues
Returns all values.- Returns:
- All values.
-
addValue
Add a value to the indexer.- Parameters:
value
- The value.
-
removeValue
Remove a value from the indexer.- Parameters:
value
- The value.
-
match
Tests if the search specification matches a value (spec=query).- Parameters:
value
- The value.- Returns:
- True, if the value matches.
-
matchOr
Tests if the search specification matches a value (spec=service, value=query).- Parameters:
value
- The value.- Returns:
- True, if the value matches.
-
getKeyExtractor
Gets the key extractor used by the service.- Returns:
- The key extractor.
-
clear
public void clear()Clears all contained values. -
updateIndex
Update an index for all values.
-