In the great majority of cases, it is easiest to set a filter query with the <rql-filter>
tag. However, there are two other ways of defining the filter used by an item descriptor. You might want to use one of these techniques if you need to set the filter query at runtime:
Set the
filterQuery
property of the item descriptor to a Query created by the same repository. Do this by creating a Query object and callingGSAItemDescriptor.setFilterQuery()
on it.Set the item descriptor’s
rqlFilterString
to an RQL string that expresses the query. If thefilterQuery
property of the item descriptor is null, the SQL repository tries to use therqlFilterString
and compile it into the filter query. If both properties are null, filtering is disabled.
Note: For best performance, two constraints apply:
filterQuery
orrqlFilterString
should refer only to properties in the primary table for the item descriptor. Otherwise, joins are required for every item access, which can dramatically degrade repository performance.Do not change the filter too often—more than once or twice a day. Each query executed by the SQL repository is AND’d to the filter query before being executed (or looked up in the cache). Too frequent changes to the filter or the RQL filter parameters diminish effectiveness of the query cache.