|
Name | Description | Boolean | Sample | Tiki Version |
---|---|---|---|---|
categories | Match on the object's directly associated categories | yes | 1 OR 3 (orphan will work) | 7 |
content | Full text search on all of the object's content Additional field argument can be provided to search for other fields instead of the default ones. |
yes | hello world | 7 |
contributors | user login to search for as the contributors for the content | yes | admin OR testuser | 8 |
deepcategories | Match on the object's categories or their parents, providing deep searching | yes | 1 OR 3 | 8 |
distance | filtering on object location by distance (Seems to work with Elasticsearch only - Tiki19.1) | no | {filter distance="10km" lat="51.5287336" lon="-0.3824611"} |
16.1 |
exact | Exact text search Use with the field argument to search for an exact title or field value. Can be used to look for empty tracker field {filter field="tracker_field_foobar_text" exact=""} |
yes | hello world | 13 |
favorite | Show only the favorited objects of a certain user. The feature Wiki Argument Variables must be set | no | {filter favorite="{{user}}"} | 8 |
field | Basic filter by field contents For the full list of fields see Unified Index |
yes | {filter field="title" content="foo"} , {filter field="tracker_id" content="42"} , {filter field="tracker_field_foobar" content="John Doe"} , {filter field="tracker_status" content="o OR p"} , {filter field="blog_excerpt" content="Some text"} |
7 (and onwards with more fields arriving most releases) |
language | Search on the object's language (2-letter code) when available. unknown is used when unspecified. | yes* | en or fr OR unknown | 7 |
multivalue | needed when filtering on array type fields like users' groups | no | Customers OR Staff | ? |
personalize | to filter down to own contributions without relying on argument variables | ? | ? | 12 |
range | A date (unix timestamp) range Must have from and to arguments specified |
no | < searchfieldname > |
8 |
range | In Tiki 9, from and to can now take now instead of a unix timestamp, and you can also set either from or to together with "gap" to specify the one relatively to the other |
no | < searchfieldname > |
9 |
relation | Must have certain relation Additional field arguments objecttype and qualifier (the relationship) must be specified |
no | < ob |
8 |
similar | Find objects similar to this or a specified other object | no | Similar to current:{filter similar="this"} or {filter similar=""} Similar to tracker item: {filter similar="trackeritem:42"} |
21.2 |
textrange | A text range Must have from and to arguments specified |
no | < searchfieldname > |
8 |
type | Filter on object type | no | wiki page (from Tiki 8 you can search for multiple types by providing a comma separated list)trackeritem to search trackers |
7/8 11 or earlier |
* AND matching won't make much sense, single-value field
{filter field="title_initial" content="A"}
Since Tiki20 you can set directly a parameter to change several filter types from "hidden" to "editable" and doing so, select on the fly an existing value of a field and output results. This is very handy to set quickly a modifiable filters instead of using the plugin customSearch that require much more work.
{filter field="tracker_field_ABC" editable="y"}
See also: PluginList with editable filters
When applying an individual filter more complex logic can also be applied using a Boolean syntax - that applies to all aspects of Unified Search - e.g. when filtering on content you could exclude all items not containing the word "water" by using:
{filter content="NOT water"}
To filter for a empty or non-empty fields, the syntax might depend on the Search and List from Unified Index engine.
{filter content="NOT "}
{filter exact=""}
The categories filter parameter will work like an EXACT filter and in the sample below ONLY object within the category 27 will be outputted. You can filter more categories by adding "AND" or "OR" operator.
{filter categories="27"}
The deepcategories filter parameter will work like a more flexible filter and in the sample below object within the category 27 or object in a child category of 27 will be outputted. Same, you can filter more categories by adding "AND" or "OR" operator.
{filter deepcategories="27"}
Tiki has a specific filter for object that are not categorised: "orphan"
You will find an example for this usage down below.
To list the sub-categories under a category you need to set searchable_only=0
to allow the plugin to list indexed fields that are not available for Search. See: https://doc.tiki.org/Search-and-List-from-Unified-Index#Searchable_and_not_searchable
You will find an example for this usage down below.
When using Elasticsearch as the Unified Search Index, you need to be aware of a few peculiarities:
tracker_field_myPermanentName_text
, searching for stopword will result in nothing and searching for an empty value will show those fields containing a stopword. So, instead of seeing all empty ones, you will see all empty ones and all the ones that have a stopword in them - like all the "No" ones. This is undesired, so if you have such a field and need to filter on a stopword, please update the list of stopwords to exclude that specific value.
{LIST()} {pagination max="10"} {filter content="hello world"} {filter categories="1 AND 2"} {filter language="en or unknown"} {filter type="wiki page,trackeritem"} {filter range="modification_date" from="2014-01-01" to="last week"} {LIST}
The date filters use strtotime to convert various common formats to Unix epoch. Unlike what the documentation previously said, this has always been the case.
{LIST()} {pagination max="11"} {filter field="gallery_id" content="5"} {LIST}
{LIST()} {filter type="file"} {pagination max="1"} {filter field="gallery_id" content="5"} {OUTPUT()}<img src="display{display name="object_id"}" alt="">{OUTPUT} {LIST}
You can list uncategorized objects.
{CODE(caption="List the object not categorized"}
{filter categories="orphan"}
{CODE}
{LIST(searchable_only="0")} {filter deepcategories="15"} {filter type=category} {LIST}
Parameters to, from and gap:
In Tiki 15, the date filters are based on seconds and the following are possible:
{filter range="tracker_field_myDate" gap="86400" to="now"} {* Within the last day *}
From Tiki 16+, the date filter has been "humanised" and the following date filters are possible:
{filter range="tracker_field_myDate" gap="1 day" to="now"} {* Within the last day *} {filter range="tracker_field_myDate" gap="10 years" to="-1 week"} {* Older than one week *} {filter range="tracker_field_myDate" gap="1 week" to_field="tracker_field_myDeadline"} {* 1 week before the deadline *} {filter range="modification_date" from="-10 years" gap="1 year"} {* Between 9 and 10 years ago *} {filter range="modification_date" gap="1 year" to="10 years"} {* In between 9 and 10 years from now *} {filter range="modification_date" from="-40 years" to="now"} {* Within the last 40 years; a.k.a, "in the past" *} {filter range="modification_date" from="2014-01-01" to="last week"}
You can also filter using human value like this month, next month, etc.
{filter range="creation_date" from="first day of this month" to="first day of next month midnight"} => This month {filter range="creation_date" from="first day of previous month" to="first day of this month"} => Previous month
From Tiki 24.1+, it is possible to include missing values like this:
{filter range="tracker_field_myDate" from="" to="now"} {* All dates in the past or entries without a date set *}
In Tiki 26+ (not sure since when it is available), it is possible to set a simple filter on a date field for the code to understand the filter is a about a range of dates (from - to) and display a field with a date picker:
{filter field="tracker_field_attendancereportsDate" editable="y"}
Unix timestamps may also be used. In Tiki 9+, the following date filters are possible:
{filter range="modification_date" from="1317427200" to="now"} {filter range="modification_date" gap="31536000" to="now"} {filter range="modification_date" from="now" gap="31536000"}
When you use Elasticsearch as the unified search index, you can reuse the same parameters to, from and gap that are shown above for Date ranges:
{filter range="tracker_field_myPermanentName" from="40" gap="100"}
This will display items which have the field with permanent name "myPermanentName" with values starting at 40 and up to 100 numbers higher (from 40 to 140).
{LIST()} {list max="10"} {filter content="hello world"} {filter categories="1 AND 2"} {filter content=5 field=tracker_id} {LIST}
{LIST()} {list max="1"} {filter content="2" field="tracker_id"} {filter field="tracker_field_username" content="{{user}}"} {LIST}
If you have __usernames made of several words and containing space(s)_ between them "content" filter won't work. You'll need to use "exact".
{LIST()} {list max="1"} {filter content="2" field="tracker_id"} {filter field="tracker_field_username" exact="{{user}}"} {LIST}
If you have your tracker set up to allow selecting several users in the tracker field users, you have to use instead:
{LIST()} {list max="1"} {filter content="2" field="tracker_id"} {filter field="tracker_field_username" multivalue="{{user}}"} {LIST}
{LIST()} {filter content="2" field="tracker_id"} {filter field="tracker_status" content="o OR p"} {LIST}
{LIST()} {filter content="2" field="tracker_id"} {filter field="tracker_field_fieldPermanentName" exact=""} {LIST}
Note: This is the object title, for the tracker items it is set in the fields (list) parameters.
{LIST()} {filter content="2" field="tracker_id"} {filter field="title_initial" content="B"} {LIST}
{LIST()} {filter type="wiki page"} {filter field="title" content="foo"} {LIST}
{LIST()} {filter type="wiki page"} {filter field="title" content="\"foo bar\""} {LIST}
{LIST()} {filter type="wiki page"} {filter field="title" exact="foo bar"} {LIST}
{LIST()} {filter content="\"hello world\" OR \"goodbye world\""} {LIST}
{LIST()} {filter field="object_type" content="user"} {filter field="groups" multivalue="Customers OR Staff"} {LIST}
In this example we want to find all objects related to trackeritem itemId 42 related using the qualifier thing.related.content
. Note we need to add .invert to the end of it becasue they are all related via a Relations field on this tracker, so the relation from their point of view is "inverted"
{LIST()} {filter relation="42" objecttype="trackeritem" qualifier="thing.related.content.invert"} {LIST}
{LIST()} {filter relation="page name" objecttype="wiki page" qualifier="thing.related.content"} {LIST}
This permits an OR query on two fields
{filter field="tracker_field_TaskAssignedTo" content="devsecops" group="together"} {filter field="tracker_field_TaskSummary" content="devsecops" group="together"}
This allows searching for a task assigned to the user devsecops or with devsecops in the summary.
This is available since Tiki26: https://gitlab.com/tikiwiki/tiki/-/commit/23570b601811176840897824f6e66427ab00563e
For a list of available types: Search and List from Unified Index
Alias names of this page:
listfilter | listfilters | list filter | list filters | listfilterrange | filterrange