Skip to content
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

fix(DQL): ignore ordering of indexes in schema with eq function #7034

Merged
merged 1 commit into from
Dec 3, 2020

Conversation

OmarAyo
Copy link
Contributor

@OmarAyo OmarAyo commented Dec 1, 2020

Previously, the following schema:

name: string @Index(trigram, term) .
with some added data, and the following query:

query {
q(func: eq(name, "Alice", "Bob")) {
uid
name
}
}
would error out saying it doesn't have a valid tokenizer:

{
"errors": [
{
"message": ": Attribute name does not have a valid tokenizer.",
"extensions": {
"code": "ErrorInvalidRequest"
}
}
],
"data": null
}
even though term index is present on the predicate.
On the other hand, if you reversed the order of indexes:

name: string @Index(term, trigram) .
It would give correct results:

{
"data": {
"q": [
{
"uid": "0x2",
"name": "Alice",
"age": 20
},
{
"uid": "0x3",
"name": "Bob",
"age": 25
}
]
}
}
This PR fixes the above issue.

(cherry picked from commit 0b11439)


This change is Reviewable

@OmarAyo OmarAyo added the area/indexes Related to indexes (indices) and their usage. label Dec 1, 2020
Copy link
Contributor

@danielmai danielmai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on @danielmai, @manishrjain, and @MichaelJCompton)

@OmarAyo OmarAyo merged commit 8568dd6 into release/v20.03 Dec 3, 2020
@OmarAyo OmarAyo deleted the omar/v20.03-fix-index-ordering branch December 3, 2020 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/indexes Related to indexes (indices) and their usage.
Development

Successfully merging this pull request may close these issues.

3 participants