Kumar Bibek
Kumar Bibek

Reputation: 9117

Couchbase Lite - FTS and indexing

I have created an index for FTS to work on say "Cars". But I also have another model called "Bikes".

I have the following structure:

{ "type": "Car", "description": "..."}, {"type": "Bike", model: "..."}

I have created an index on the property "description".

Now, when indexes are created, I can see there are entries for Car, which is fine. But it also shows indexes being created for Bike, with values NULL.

I have multiple entries of Cars and Bikes, and thus have multiple NULL valued indexes being created.

Is this by design? What approach should I take to have both Car and Bike models in the same database, but I only want to implement FTS for Cars. Couchbase Lite doesn't allow me to create conditional indexes, where I could specify the "type".

Upvotes: 0

Views: 162

Answers (1)

borrrden
borrrden

Reputation: 33423

The functionality you are referring to is know as "partial indexes" which is a feature that is unfortunately not available, and not planned for release yet (as of 2.6.0). Couchbase has a tracking ticket for it here and so if you like you can comment that you want this feature and that will be taken into account during prioritization.

You can still have the information in the same database, but you will have excess information in the index. If this causes an issue then you will need to separate them.

Upvotes: 3

Related Questions