Is there an API in the CBL C SDK that can be used to create a predictive index? I see the kC4PredictiveIndex constant can be used through the c4coll_createIndex API in LiteCore, but this appears to be the only API not available in the C SDK itself, now that CBL_RegisterPredictiveModel and CBL_UnregisterPredictiveModel are available in 3.2.
I’ve also been curious the difference between the Index and IndexConfiguration APIs. Index preceded IndexConfiguration. IndexConfiguration was added in 3.0, but only for Value and FullText indexes, not Predictive. Index has never been officially deprecated, but IndexBuilder (used for the Index API) in the Java SDK does say (in the EE SDK, but not CE):
IndexBuilder used for building database indices.
Use Database.createIndex(IndexConfiguration, String) instead.
Value and FullText indexes are available in both APIs. But Array and Vector indexes were only added to the IndexConfiguration API, while Predictive indexes remain only in the Index API.
C sometimes has extenuating circumstances, but for the other platforms the Index APIs are deprecated and are not receiving new features. They are being removed in 4.0. As far as predictive queries go, I am not sure why it is inconsistent like that. My best guess is that there was no demand for the predictive query feature, and the reason that those two API were added was that they are useful for vector search (which is like predictive query but better in every way). I’ll ask @pasin to chime in and correct anything incorrect that I’ve said.
Thanks for the info. I half expected the Index APIs to be officially @Deprecated in the code, since the functionality is mostly duplicated by IndexConfiguration. But maybe it’s only because of the PredictiveIndex that they haven’t been. Will the predictive indexes be removed in 4.0 as well?
Predictive Query and Predictive Index (Only via IndexBuilder API, Not SQL++/N1QL) will not be removed. It’s just that CBL-C doesn’t have Predictive Index supported.
We brought Predictive Model and SQL++’s Prediction() function to CBL-C only for creating Vector Index with a ML model via the SQL++’s Prediction() function.