and this below is my function in which i want nested query to get the desired result - @override
Future<List<Document>> getSavedBlogsByHashtag(
String hastag, UserModel user) async {
final documents = await _db.listDocuments(
databaseId: AppConstants.APPWRITE_DATABASE_ID,
collectionId: AppConstants.APPWRITE_BLOGS_COLLECTION,
queries: [
Query.equal('\$id', user.SavedPosts),
Query.search('hastags', hastag),
Query.orderDesc('createdAt'),
Query.limit(100),
]);
return documents.documents;
}
The last one should work
What are you getting back?
i am getting a blank screen with a laoder
but i tried printing hashtag in function
it is correct
the function is getting the hashtag
Try to print it and surround it with try catch like so and share the results
@override
Future<List<Document>> getSavedBlogsByHashtag(
String hastag, UserModel user) async {
try {
final documents = await _db.listDocuments(
databaseId: AppConstants.APPWRITE_DATABASE_ID,
collectionId: AppConstants.APPWRITE_BLOGS_COLLECTION,
queries: [
Query.equal('\$id', user.SavedPosts),
Query.search('hastags', hastag),
Query.orderDesc('createdAt'),
Query.limit(100),
]);
print(documents);
return documents.documents;
} catch (e){
print(e);
return null;
}
}
getting this - Documents: Instance of 'DocumentList'
And this
print(documents.documents);
Documents.documents: []
So
$idalone workshashtagsalone works- Togther doesn't work ?
Yeah first two functions are working fine but not the third one
This is weird just tested it and it should work
Can you try with other hashtags?
maybe is a index issue? 🤔
I think in that case it should give error that hastags is not a fulltext index
But it's worth checking is hashtags has fulltext index on it?
If I'm not wrong from v1.3 you won't get index error
Also for fullText?
I'm not sure to be honest
Strict indexes for queries in Appwrite 1.3 are no longer necessary! If you ever used Appwrite Databases, chances are, you have seen the error ⚠️Index Not Found. Such strict indexes can get in the way during development and can be a blocker to some use cases with complex filtering possibilities. With Appwrite 1.3, you are no longer going to get errors telling you to set up an index.
I found this from v1.3 release
🤣 I hope we don't let you full text search without index
Tha
That's not a good idea at all
Recommended threads
- Impossible to get USER after createEmail...
Am using provider to deal with functions linked to appwrite. Here is my login. Future<String?> login(String email, String password) async { try { aw...
- Weird permission failure
when creating an account I use following methods: ``` Future<void> register(String email, String password, String username) async { final user = await accoun...
- Flutter Android oAuth is no more working
I currently don't get the oAuth login to work in flutter android. it works on ios and on web. but when try to use it on Android, i get to the point where the ca...