Back

indexes in appwrite db

  • 0
  • Databases
  • Web
Surya Ashish
4 Jun, 2023, 10:59

Hey, i need help in writing query for getting documents in a collection filtered by user_id

TL;DR
The support thread is discussing how to create indexes in the Appwrite database and how to write a query to filter documents by user ID. Solution: To create an index in the Appwrite dashboard, navigate to the index section and define it. For filtering documents by user ID, use the appropriate attribute name and set the index type as "fulltext." If you encounter any errors, provide the code causing it and a screenshot of the index section in the Appwrite dashboard for further assistance.
D5
4 Jun, 2023, 11:01

You need to create an index

D5
4 Jun, 2023, 11:01

From appwrite dashboard

D5
4 Jun, 2023, 11:02

If you already created one and still see such error, send here the code causing it and what you're indexing (appwrite dashboard screenshot of the index section)

D5
4 Jun, 2023, 11:52

@Surya Ashish

Surya Ashish
4 Jun, 2023, 11:52

wait

D5
4 Jun, 2023, 12:07

Okay 😄

Surya Ashish
4 Jun, 2023, 15:01
Surya Ashish
4 Jun, 2023, 15:02

tell me how to write an index for this use case

D5
4 Jun, 2023, 15:24

You dont need to write it, go to your appwrite dashboard and define it

Surya Ashish
4 Jun, 2023, 17:10

how to define them

Surya Ashish
4 Jun, 2023, 17:11

what values should i put in

Susmita
4 Jun, 2023, 17:28

make index_type as fulltext

Susmita
4 Jun, 2023, 17:29

select the attribute name which you wanna query

Surya Ashish
4 Jun, 2023, 17:44

thanks

Drake
4 Jun, 2023, 21:16

You only need a full text index if you're using the search query. Key index is probably enough

Susmita
5 Jun, 2023, 03:53

Yeah that's what I was saying as it's related to querying

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more