documentation icon indicating copy to clipboard operation
documentation copied to clipboard

Add comparison of implicit vs. explicit index creation

Open dichotommy opened this issue 3 years ago • 1 comments

In the main concept guide, we should definitely add an implicit vs. explicit comparison section similar to MongoDB's.

  • Implicit: default option, simple, less code.
  • Explicit: much more error-proof. This is because implicit index creation is actually two actions (1. Create index, 2. Add documents to said index) tied to one command (add documents). Unlike all other actions in MeiliSearch which are atomic, it is possible for only one of these two actions to complete successfully (index is created, but documents are not added). This can cause errors or missing documents.

Inspired by #583

dichotommy avatar Mar 17 '21 21:03 dichotommy

"Merging" this issue with #1043. Relevant bits of the discussion there:

In the documents core concept it would be interesting to explain that when you add documents in an index that does not exist, the index will be created automatically.

In indexes core concept it could be an idea to talk about the implicit index creation. Apparently not only POST /documents creates the index in the background.

the index creation part seems like a good place.

guimachiavelli avatar Sep 02 '21 12:09 guimachiavelli