uuid not working as expected
I have defines objectId : id @index When I use allof instead of eq, it works as expected...
me(eq("name", "TestWebsite")) {
objectId
name
}
}
results in:
{"me":[{"name":"TestWebsite","objectId":"e0247678-acae-5364-89d4-e61476892142"}]}
But:
me(eq("objectId", "e0247678-acae-5364-89d4-e61476892142")) {
objectId
name
}
}
results in: {"code":"ErrorInvalidRequest","message":"Expected only 1 token but got: [e0247678 acae 5364 89d4 e61476892142]"} (edited)
We should have a way to have an id type, where we store the string in it's entirety; so we can do equality comparisons over UUIDs and others.
you need to specify exact tokenizer in schema. objectId : id @index(exact)
By default term tokenizer is picked up for strings which uses icu to tokenize the string and it splits up on "-".
@AndreSteenbergen Does this work for you? Can we close this issue?
still looks strange to me that an eq function does tokenizes, but yes, can be closed.
Actually, @AndreSteenbergen does have a point. eq function shouldn't be tokenizing the function arguments. We should fix that.
This is related to #618, moving it to v0.8.
If you set exact tokenizer for the predicate, then eq, leq, geq would all work; because they'd be using the exact value for comparisons.