Search

Filter documents

When viewing document list, a search bar is shown on top of the documents. The bar supports full-text-search, meaning that user can enter any words, and those words are matched against the document’s name, description, metadata and document’s extracted content. Typos are allowed when searching.

In addition to full-text-search, the search bar can be used to filter document’s date as well as metadata key-values.

Examples

Following examples make use of all of the features listed below.

QUERY
full metal jacket
Does a full-text-search query.
QUERY
type:movie full metal jacket
Filters with the metadata key "type:movie" and also does a full-text-search query for the remaining words.
QUERY
date:2023 type:movie full metal jacket
Additionally, filters results that are dated in 2023.

Every word in the query is used as full-text-search query, unless they’re explicitly idenfitied as either metadata filter or date filter.

Any words that are not matched as metadata or date are treated as full-text-search. Maximum number of words are 10. Even though it is possible to query with longer sentences, only the 10 first words are used when quereying for results.

Full-text-search is typo-tolerant and also utilizes user-customizable synonyms and stop words. For more information please refer to Meilisearch documentation.

Metadata

Metadata query must be formatted as “key:value”. Multiple metadata filers are allowed and some logical operations are available. The position of the metadata queries does not matter.

QUERY
key:value full metal jacket
Is equivalent to:
QUERY
full key:value metal jacket
Filters documents that contain text "full metal jacket" and have metadata key:value.

It doesn’t matter where in the query the metadata filters are inserted in. If there are multiple key-values in one query, all of them must match the document by default. It is possible to OR and even chain several key-value filters using parantheses:

QUERY
key:value AND another:keyvalue full metal jacket
OR
QUERY
full metal jacket (key:value AND another:keyvalue OR something:else)

Date range

Date is treated the same way as metadata: the query is full-text-search unless some word matches as date. The search bar will suggest several date formats, such as today, yesterday, year. The date option access one to two arguments. With one argument, all documents that match the date text are matched. In one argument mode, it is possible to filter documents dated inside one year, month or day.

QUERY
date:<date-expression>
Examples for format with one argument:

QUERY
date:today
Match all documents that are dated for today.
QUERY
date:month
Match all documents that are dated in this month.
QUERY
date:2020
Match all documents that are dated in year 2020.
QUERY
date:2022-02-27
Match all documents in 2022-02-27.

Date range with end date

With two arguments, all documents between the two dates are matched.

QUERY
date:<beginning>|<end>
Match documents between two date expressions.
QUERY
date:2020|today
Match all documents from beginning of 2020 until today.
QUERY
date:year|month
Match all documents from beginning of this year until beginning of this month.
QUERY
date:2015-01-10|2015-02
Match all documents between 2015-01-10 and 2015-02-01.