Skip to content

Add info about changes introduced by PR #4531 #4591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions wiki/content/query-language/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,19 @@ Query Example: Some of Bollywood director and actor Farhan Akhtar's movies have

## Functions

{{% notice "note" %}}Functions can only be applied to [indexed]({{< relref "#indexing">}}) predicates.{{% /notice %}}
Functions allow filtering based on properties of nodes or [variables]({{<relref "#value-variables">}}). Functions can be applied in the query root or in filters.

Functions allow filtering based on properties of nodes or variables. Functions can be applied in the query root or in filters.
{{% notice "note" %}}Support for filters on non-indexed predicates was added with Dgraph `v1.2.0`.
{{% /notice %}}

Comparison functions (`eq`, `ge`, `gt`, `le`, `lt`) in the query root (aka `func:`) can only
be applied on [indexed predicates]({{< relref "#indexing">}}). Since v1.2, comparison functions
can now be used on [@filter]({{<relref "#applying-filters">}}) directives even on predicates
that have not been indexed.
Filtering on non-indexed predicates can be slow for large datasets, as they require
iterating over all of the possible values at the level where the filter is being used.

All other functions, in the query root or in the filter can only be applied to indexed predicates.

For functions on string valued predicates, if no language preference is given, the function is applied to all languages and strings without a language tag; if a language preference is given, the function is applied only to strings of the given language.

Expand Down Expand Up @@ -468,7 +478,7 @@ Syntax Examples:

Schema Types: `int`, `float`, `bool`, `string`, `dateTime`

Index Required: An index is required for the `eq(predicate, ...)` forms (see table below). For `count(predicate)` at the query root, the `@count` index is required. For variables the values have been calculated as part of the query, so no index is required.
Index Required: An index is required for the `eq(predicate, ...)` forms (see table below) when used at query root. For `count(predicate)` at the query root, the `@count` index is required. For variables the values have been calculated as part of the query, so no index is required.

| Type | Index Options |
|:-----------|:--------------|
Expand Down Expand Up @@ -530,7 +540,7 @@ With `IE` replaced by

Schema Types: `int`, `float`, `string`, `dateTime`

Index required: An index is required for the `IE(predicate, ...)` forms (see table below). For `count(predicate)` at the query root, the `@count` index is required. For variables the values have been calculated as part of the query, so no index is required.
Index required: An index is required for the `IE(predicate, ...)` forms (see table below) when used at query root. For `count(predicate)` at the query root, the `@count` index is required. For variables the values have been calculated as part of the query, so no index is required.

| Type | Index Options |
|:-----------|:--------------|
Expand Down