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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Bug Report: How to search full collection #6892

Closed
2 tasks done
SMARTMICROWORLD opened this issue Oct 12, 2023 · 4 comments
Closed
2 tasks done

馃悰 Bug Report: How to search full collection #6892

SMARTMICROWORLD opened this issue Oct 12, 2023 · 4 comments
Assignees
Labels
bug Something isn't working product / databases Fixes and upgrades for the Appwrite Database.

Comments

@SMARTMICROWORLD
Copy link

馃憻 Reproduction steps

How to search full collection if i have multiple attribute index like this??

ss

馃憤 Expected behavior

I want to get results from all column that is selected in index.

馃憥 Actual Behavior

But I am getting:
AppwriteException: Invalid query: Attribute not found in schema: text,category,main_category
AppwriteException: Invalid query: Attribute not found in schema: text,category,main_category

馃幉 Appwrite version

Appwrite Cloud

馃捇 Operating system

Linux

馃П Your Environment

I am using Appwrite cloud on react native

馃憖 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

馃彚 Have you read the Code of Conduct?

@SMARTMICROWORLD SMARTMICROWORLD added the bug Something isn't working label Oct 12, 2023
@SMARTMICROWORLD
Copy link
Author

SMARTMICROWORLD commented Oct 12, 2023

The code:

appwriteDatabases
      .listDocuments(DATABASE_ID, CONTENTS_COLLECTION_ID, [
        Query.search('text,category,main_category', 'anim'),
      ])
      .then(data => console.log(data));

because:

index_9   fulltext   text,category,main_categor   ASC,ASC,ASC

@stnguyen90 stnguyen90 added the product / databases Fixes and upgrades for the Appwrite Database. label Oct 12, 2023
@stnguyen90 stnguyen90 self-assigned this Oct 12, 2023
@stnguyen90
Copy link
Contributor

@SMARTMICROWORLD, thanks for creating this issue! 馃檹馃徏 The search query (just like any other filter query such as Query.equal() only works on 1 attribute. So you would do Query.search('text' 'anim').

If I understand you correctly, the logic you're looking for is like:

Query.search('text' 'anim') OR Query.search('category' 'anim') OR Query.search('main_category' 'anim')

This type of query is not supported yet. I suggest you 馃憤馃徏 the related issue to express your interest and stay updated on the feature request.

For now, I would suggest either:

  1. Make 3 full text indexes (1 for each attribute) and make 3 separate API calls searching on each attribute
  2. Create a search attribute that has data from all 3 attributes and create 1 full text index on that attribute

For now, I'm going to close this issue since we already have #2740.

@stnguyen90 stnguyen90 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 12, 2023
@SMARTMICROWORLD
Copy link
Author

@SMARTMICROWORLD, thanks for creating this issue! 馃檹馃徏 The search query (just like any other filter query such as Query.equal() only works on 1 attribute. So you would do Query.search('text' 'anim').

If I understand you correctly, the logic you're looking for is like:

Query.search('text' 'anim') OR Query.search('category' 'anim') OR Query.search('main_category' 'anim')

This type of query is not supported yet. I suggest you 馃憤馃徏 the related issue to express your interest and stay updated on the feature request.

For now, I would suggest either:

  1. Make 3 full text indexes (1 for each attribute) and make 3 separate API calls searching on each attribute
  2. Create a search attribute that has data from all 3 attributes and create 1 full text index on that attribute

For now, I'm going to close this issue since we already have #2740.

Thanks for this help but these are temporary solutions I want advanced search like elastic or algol... in appwrite

@vinay-sd17
Copy link

vinay-sd17 commented Dec 19, 2023

Query.search('text' 'anim') OR Query.search('category' 'anim') OR Query.search('main_category' 'anim')

Hi, If I want to search for a single full-text field - with an OR condition inside the search, like below query

Query.search("fullTextCol", [ "node", "next"]). Is it allowed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product / databases Fixes and upgrades for the Appwrite Database.
Projects
None yet
Development

No branches or pull requests

3 participants