firestore-meilisearch 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -44,12 +44,11 @@ Before installing this extension, you'll need to:
44
44
 
45
45
  #### Data import format
46
46
 
47
- Documents indexed in Meilisearch must have a [unique id](https://docs.meilisearch.com/learn/core_concepts/documents.html#primary-field). The extension will use Firestore's default field: `Document ID` for this purpose. `Document ID` will be renamed to`_firestore_id` to be used as the [document id](https://docs.meilisearch.com/learn/core_concepts/documents.html#document-id). If your documents have another field containing the string `id`, it will not be set as the primary key.
47
+ Documents indexed in Meilisearch must have an [unique id](https://docs.meilisearch.com/learn/core_concepts/documents.html#primary-field). Meilisearch uses Firestore's default field: `Document ID` for this purpose, and renames it to`_firestore_id`.
48
48
 
49
49
  **Important:** If your documents contain a field called `_firestore_id`, it will be ignored.
50
50
 
51
- [Geosearch](https://docs.meilisearch.com/reference/features/geosearch.html#geosearch) has a specific format in Meilisearch, your documents must have a valid `_geo` field with an object composed of `lat` and `lng`. If a `GeoPoint` from Firestore with the name `_geo` is found, the field `latitude` is renamed to `lat` and `longitude` to `lng`.
52
- If a `GeoPoint` is found without the name `_geo`, it is added as an array.
51
+ If you are using `GeoPoint`, the field should be named `_geo` to be recognized by Meilisearch for [geosearch]((https://docs.meilisearch.com/reference/features/geosearch.html#geosearch)).
53
52
 
54
53
  #### Backfill your Meilisearch data
55
54
 
package/lib/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
- exports.version = '0.1.7';
4
+ exports.version = '0.1.8';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firestore-meilisearch",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "scripts": {
5
5
  "lint": "eslint .",
6
6
  "lint:fix": "eslint . --fix",
package/src/index.ts CHANGED
@@ -67,7 +67,13 @@ async function handleAddDocument(
67
67
  logs.addDocument(documentId)
68
68
  if (validateDocumentId(documentId)) {
69
69
  const document = adaptDocument(documentId, snapshot)
70
- await index.addDocuments([document], { primaryKey: '_firestore_id' })
70
+ const { taskUid } = await index.addDocuments([document], {
71
+ primaryKey: '_firestore_id',
72
+ })
73
+
74
+ logger.info(
75
+ `Document addition request for document with ID ${documentId} added to task list (task ID ${taskUid}).`
76
+ )
71
77
  } else {
72
78
  logger.error(
73
79
  `Could not create document with id: ${documentId}. The document id can only contain case-insensitive alphanumeric characters (abcDEF), hyphens (-) or underscores(_).`
@@ -86,7 +92,11 @@ async function handleDeleteDocument(documentId: string): Promise<void> {
86
92
  try {
87
93
  logs.deleteDocument(documentId)
88
94
  if (validateDocumentId(documentId)) {
89
- await index.deleteDocument(documentId)
95
+ const { taskUid } = await index.deleteDocument(documentId)
96
+
97
+ logger.info(
98
+ `Document deletion request for document with ID ${documentId} added to task list (task ID ${taskUid}).`
99
+ )
90
100
  } else {
91
101
  logger.error(
92
102
  `Could not delete document with id: ${documentId}. The document id can only contain case-insensitive alphanumeric characters (abcDEF), hyphens (-) or underscores(_).`
@@ -110,7 +120,11 @@ async function handleUpdateDocument(
110
120
  logs.updateDocument(documentId)
111
121
  if (validateDocumentId(documentId)) {
112
122
  const document = adaptDocument(documentId, after)
113
- await index.addDocuments([document])
123
+ const { taskUid } = await index.addDocuments([document])
124
+
125
+ logger.info(
126
+ `Document update request for document with ID ${documentId} added to task list (task ID ${taskUid}).`
127
+ )
114
128
  } else {
115
129
  logger.error(
116
130
  `Could not update document with id: ${documentId}.The document id can only contain case-insensitive alphanumeric characters (abcDEF), hyphens (-) or underscores(_).`
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '0.1.7'
1
+ export const version = '0.1.8'