Skip to content
Back

indexing is not working properly

  • 0
  • Databases
  • Flutter
  • Cloud
conqueror
6 Jun, 2023, 16:46

but cant assign same product id again

TL;DR
The user is having trouble with indexing not working properly. They are unable to delete posts and are experiencing failures in index creation. The solution suggested is to change the attribute size for string indexing. Additionally, the user wants to ensure that product IDs are unique for different products. The solution suggested is to add another attribute called "user_id" and create a unique index combining "user_id" and "id". This way, each user can only have each product once.
Binyamin
6 Jun, 2023, 16:46

biscuit? Meaning?

conqueror
6 Jun, 2023, 16:46

that what i want

Binyamin
6 Jun, 2023, 16:47

Ohh okay

Binyamin
6 Jun, 2023, 16:48

So here you said the user B is also able to add that product?

Binyamin
6 Jun, 2023, 16:48

So, What part you want to make unqiue?

conqueror
6 Jun, 2023, 16:48

want to set unique my product id so that one user cant use same product id for differrent produt or i can say handling dupplicate

Binyamin
6 Jun, 2023, 16:50

So you want to make sure that the combination of Product+ID is unqiue?

conqueror
6 Jun, 2023, 16:51

meaning ?

Binyamin
6 Jun, 2023, 16:51

What part you want to be unqiue in your collection? What set of data?

Binyamin
6 Jun, 2023, 16:52

Okay, What are those two fields? id - product id barcode - ?

And what's not working?

Binyamin
6 Jun, 2023, 16:53

Okay

Binyamin
6 Jun, 2023, 16:57

There is no out-of-the-box way to achieve this.

What I would do is to add another attribute name user_id, then I will create a unique index that combined user_id + id This way I can rest assure that any user can have any product just once.

conqueror
6 Jun, 2023, 17:02

index creation failed . again and again

Binyamin
6 Jun, 2023, 17:04

This probably because you've two-values that are the same.

When you've added the user_id attribute, it's now empty? if so make sure you don't have any two id values that are the same

Binyamin
6 Jun, 2023, 17:04

Because if they are the same you won't be able to add unique as it's not unique.

conqueror
6 Jun, 2023, 17:04

index creating is fail in clould version if size is more the 400 for string, changed size now able to create indexing

conqueror
6 Jun, 2023, 17:05

but this is not if my attribute size is large

conqueror
6 Jun, 2023, 17:07

@Binyamin Thanks man for your time.

Binyamin
6 Jun, 2023, 17:07

It's working now?

Binyamin
6 Jun, 2023, 17:09

👍

conqueror
6 Jun, 2023, 17:11

how can i delete this post

Binyamin
6 Jun, 2023, 17:12

Click on the menu on the top

Binyamin
6 Jun, 2023, 17:12

But I'm no sure it will delete the whole post.

Drake
6 Jun, 2023, 18:25

there's no need to delete posts. it's best to leave it for others to see how things resolved

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