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

Support for equality and inequality in filter when a predicate doens't have index #4077

Closed
mangalaman93 opened this issue Sep 27, 2019 · 1 comment
Assignees
Labels
area/querylang Issues related to the query language specification and implementation. exp/intermediate Fixing this requires some experience with the project. kind/enhancement Something could be better. priority/P2 Somehow important but would not block a release. status/accepted We accept to investigate/work on it.

Comments

@mangalaman93
Copy link
Contributor

mangalaman93 commented Sep 27, 2019

We already support regular expressions in filter even when a predicate doesn't have trigram index. We could further enhance and add support for more functions in filter when we don't have indexes for the predicates used in the filter.

Schema

firstName: string .
lastName: string .

Mutation

{
  set {
    _:luke <firstName> "Luke" .
    _:luke <lastName> "Skywalker" .
    _:leia <firstName> "Princess" .
    _:leia <lastName> "Leia" .
    _:han <firstName> "Han" .
    _:han <lastName> "Solo" .
    _:har <firstName> "Harrison" .
    _:har <lastName> "Ford" .
    _:ss <firstName> "Steven" .
    _:ss <lastName> "Spielberg" .
  }
}

Query

{
  response(func: has(firstName)) @filter(eq(firstName, "Han")) {
    uid
    firstName
    lastName
  }
}

Fails with following error:

{
  "name": "t",
  "url": "http://localhost:8180/query?timeout=60s",
  "errors": [
    {
      "message": ": Attribute firstName is not indexed.",
      "extensions": {
        "code": "ErrorInvalidRequest"
      }
    }
  ]
}

Related to #4065 #4030 a4756c2

@mangalaman93 mangalaman93 added kind/enhancement Something could be better. priority/P1 Serious issue that requires eventual attention (can wait a bit) exp/intermediate Fixing this requires some experience with the project. area/querylang Issues related to the query language specification and implementation. status/accepted We accept to investigate/work on it. labels Sep 27, 2019
@mangalaman93 mangalaman93 self-assigned this Sep 27, 2019
@campoy campoy added priority/P2 Somehow important but would not block a release. and removed priority/P1 Serious issue that requires eventual attention (can wait a bit) labels Oct 15, 2019
@mangalaman93
Copy link
Contributor Author

mangalaman93 commented Jan 9, 2020

duplicate of #4305

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/querylang Issues related to the query language specification and implementation. exp/intermediate Fixing this requires some experience with the project. kind/enhancement Something could be better. priority/P2 Somehow important but would not block a release. status/accepted We accept to investigate/work on it.
Development

No branches or pull requests

2 participants