Index Full text creation on demand

Hi, i send Realm db zipped inside my App.

If adopted FTS , it’s possible create index for FTS on demand after unzip in local device ?

thanks

Hi @Sergio_Carbonete1,

Adding a FTS index does not require a migration, so even when you created the zipped realm you didn’t have an index defined, then it should not be a problem. The index will be created when the realm is opened the first time.

Hi thanks,

If i understand first define a class without defining a [Indexed(IndexType.FullText)] attribute to generate zipped realm . And in class used to read realm i define this attribute.

  1. There is a way to made this in C# programtically ?
  2. Open local realm in read-only may cause trouble to create index ?

thanks for help

If you open the Realm as readonly, you won’t be able to create an index if one doesn’t already exist. But you can create the file with an index and zip that in your app.