I have a collection (allUsers):
{
name: "allUsers",
unique: false,
serialized: true,
source: "User",
values: [
{
field: ["data", "active"]
},
{
field: ["data", "user_name"]
},
{
field: ["data", "ethaddress"]
},
{
field: ["data", "description"]
},
{
field: ["data", "email"]
},
{
field: ["data", "mobile"]
}
]
}
and an index on that collection:
{
name: "usernameFromEthaddress",
unique: true,
serialized: true,
source: "User",
terms: [
{
field: ["data", "ethaddress"]
}
],
values: [
{
field: ["data", "username"]
}
]
}
Searching on a valid string in the dashboard I get:
NO RESULTS FOUND
No results found for the index "usernameFromEthaddress"
I checked that the address value used in the search is unique.
How do I retrieve a unique ‘username’ field value given an ‘ethaddress’ value with the usernameFromEthaddress index?
Seems like that should work from what I can see.
Is the username defined since an index will not pick up documents for which all their values are null… … and while typing this I found the error
Look at the username spelling in the index, your data says: “user_name”, the index “username”.
1 Like
Thanks, it caused a few knock on effects that I had to deal with but that fixed it.
@databrecht
From the GQL Relations example I have:
{
"ref": Ref(Collection("Todo"), "287753950702076424"),
"ts": 1610682678290000,
"data": {
"title": "Build an awesome app!",
"completed": true,
"list": Ref(Collection("List"), "287753820121858572")
}
}
in the ToDo collection and
{
"ref": Ref(Collection("List"), "287753820121858572"),
"ts": 1610682277730000,
"data": {
"title": "Development"
}
}
in the List collection.
I checked the field spellings this time.
The tutorial schema auto creates an Index: list_todos_by_list
However, if I search for list by ref “287753820121858572” I get:
No results found for the index "list_todos_by_list"
It is possible this is related to internal server error
which is currently unresolved and may be impacting indexes such as this one(?).
If that is not possible, why is the ref unable to find the document in the specified list?
Thanks …
hi @FreeRoss
May you provide me with a temporary key and I can take a look?
Please share it in private.
Thanks,
Luigi
The issue has re-surfaced, this time on a seemingly even more straightforward index search:
I have an index:
{
name: "unique_User_username",
unique: true,
serialized: true,
source: "User",
terms: [
{
field: ["data", "username"]
}
]
}
and a document:
{
"ref": Ref(Collection("User"), "290125575057572353"),
"ts": 1612944159470000,
"data": {
"active": true,
"username": "Test1",
"description": "R hander",
"email": "t1@t1.com",
"mobile": "+65 1111"
}
}
Attempting to search on username “Test1” in the Fauna UI I get
"No results found"
Why doesn’t unique_user_username find “Test1” and return the User document?
Thanks …