From 67791f1845298c8c5477e1ca77783c3541b318fb Mon Sep 17 00:00:00 2001 From: Luca Ongaro Date: Mon, 13 Jul 2020 11:23:44 +0200 Subject: [PATCH] more improvements to documentation --- docs/MiniSearch.html | 34 +++++++++--------------- docs/MiniSearch.js.html | 26 +++++++----------- docs/SearchableMap.html | 2 +- docs/SearchableMap_SearchableMap.js.html | 2 +- docs/index.html | 2 +- src/MiniSearch.js | 24 ++++++----------- 6 files changed, 33 insertions(+), 57 deletions(-) diff --git a/docs/MiniSearch.html b/docs/MiniSearch.html index 8a8ad3e0..c8e9acdb 100644 --- a/docs/MiniSearch.html +++ b/docs/MiniSearch.html @@ -646,7 +646,7 @@

(static) g
Source:
@@ -818,7 +818,7 @@

(static) loa
Source:
@@ -876,15 +876,10 @@

Example
// If the index was serialized with:
 let miniSearch = new MiniSearch({ fields: ['title', 'text'] })
 miniSearch.addAll(documents)
+
 const json = JSON.stringify(miniSearch)
 // It can later be deserialized like this:
-miniSearch = MiniSearch.loadJSON(json, { fields: ['title', 'text'] })
-
-**Warning:** JSON (de)serialization of the index is currently tightly
-coupled to the index implementation. For this reason, the current
-implementation is to be considered a _beta_ feature, subject to breaking
-changes changes in future releases. If a breaking change is introduced,
-though, it will be properly reported in the changelog.
+miniSearch = MiniSearch.loadJSON(json, { fields: ['title', 'text'] }) @@ -2669,7 +2664,7 @@

toJSONSource:
@@ -2711,9 +2706,11 @@

toJSON

Allows serialization of the index to JSON, to possibly store it and later deserialize it with MiniSearch.loadJSON.

-

Normally one does not directly call this method, but rather call -the standard JavaScript JSON.stringify() passing the MiniSearch -instance, and JavaScript will internally call this method:

+

Normally one does not directly call this method, but rather call the +standard JavaScript JSON.stringify() passing the MiniSearch instance, +and JavaScript will internally call this method. Upon deserialization, one +must pass to loadJSON the same options used to create the original +instance that was serialized.

@@ -2730,14 +2727,9 @@
Example
let miniSearch = new MiniSearch({ fields: ['title', 'text'] }) miniSearch.addAll(documents) const json = JSON.stringify(miniSearch) -// Later, to deserialize: -miniSearch = MiniSearch.loadJSON(json, { fields: ['title', 'text'] }) -**Warning:** JSON (de)serialization of the index is currently tightly -coupled to the index implementation. For this reason, the current -implementation is to be considered a _beta_ feature, subject to breaking -changes changes in future releases. If a breaking change is introduced, -though, it will be reported in the changelog. +// Later, to deserialize it: +miniSearch = MiniSearch.loadJSON(json, { fields: ['title', 'text'] }) @@ -3858,7 +3850,7 @@
Returns:

- Documentation generated by JSDoc 3.6.4 on Mon Jul 13 2020 11:17:06 GMT+0200 (Central European Summer Time) using the docdash theme. + Documentation generated by JSDoc 3.6.4 on Mon Jul 13 2020 11:23:16 GMT+0200 (Central European Summer Time) using the docdash theme.
diff --git a/docs/MiniSearch.js.html b/docs/MiniSearch.js.html index 8db87b82..083853ac 100644 --- a/docs/MiniSearch.js.html +++ b/docs/MiniSearch.js.html @@ -542,16 +542,11 @@

MiniSearch.js

* // If the index was serialized with: * let miniSearch = new MiniSearch({ fields: ['title', 'text'] }) * miniSearch.addAll(documents) + * * const json = JSON.stringify(miniSearch) * // It can later be deserialized like this: * miniSearch = MiniSearch.loadJSON(json, { fields: ['title', 'text'] }) * - * **Warning:** JSON (de)serialization of the index is currently tightly - * coupled to the index implementation. For this reason, the current - * implementation is to be considered a _beta_ feature, subject to breaking - * changes changes in future releases. If a breaking change is introduced, - * though, it will be properly reported in the changelog. - * * @param {string} json - JSON-serialized index * @param {Object} options - configuration options, same as the constructor * @return {MiniSearch} an instance of MiniSearch @@ -671,23 +666,20 @@

MiniSearch.js

* Allows serialization of the index to JSON, to possibly store it and later * deserialize it with `MiniSearch.loadJSON`. * - * Normally one does not directly call this method, but rather call - * the standard JavaScript `JSON.stringify()` passing the `MiniSearch` - * instance, and JavaScript will internally call this method: + * Normally one does not directly call this method, but rather call the + * standard JavaScript `JSON.stringify()` passing the `MiniSearch` instance, + * and JavaScript will internally call this method. Upon deserialization, one + * must pass to `loadJSON` the same options used to create the original + * instance that was serialized. * * @example * // Serialize the index: * let miniSearch = new MiniSearch({ fields: ['title', 'text'] }) * miniSearch.addAll(documents) * const json = JSON.stringify(miniSearch) - * // Later, to deserialize: - * miniSearch = MiniSearch.loadJSON(json, { fields: ['title', 'text'] }) * - * **Warning:** JSON (de)serialization of the index is currently tightly - * coupled to the index implementation. For this reason, the current - * implementation is to be considered a _beta_ feature, subject to breaking - * changes changes in future releases. If a breaking change is introduced, - * though, it will be reported in the changelog. + * // Later, to deserialize it: + * miniSearch = MiniSearch.loadJSON(json, { fields: ['title', 'text'] }) * * @return {Object} the serializeable representation of the search index */ @@ -900,7 +892,7 @@

MiniSearch.js


- Documentation generated by JSDoc 3.6.4 on Mon Jul 13 2020 11:17:06 GMT+0200 (Central European Summer Time) using the docdash theme. + Documentation generated by JSDoc 3.6.4 on Mon Jul 13 2020 11:23:16 GMT+0200 (Central European Summer Time) using the docdash theme.
diff --git a/docs/SearchableMap.html b/docs/SearchableMap.html index 4aed0d0d..10fae13e 100644 --- a/docs/SearchableMap.html +++ b/docs/SearchableMap.html @@ -2718,7 +2718,7 @@
Returns:

- Documentation generated by JSDoc 3.6.4 on Mon Jul 13 2020 11:17:06 GMT+0200 (Central European Summer Time) using the docdash theme. + Documentation generated by JSDoc 3.6.4 on Mon Jul 13 2020 11:23:16 GMT+0200 (Central European Summer Time) using the docdash theme.
diff --git a/docs/SearchableMap_SearchableMap.js.html b/docs/SearchableMap_SearchableMap.js.html index 9c3ab434..acaf063f 100644 --- a/docs/SearchableMap_SearchableMap.js.html +++ b/docs/SearchableMap_SearchableMap.js.html @@ -381,7 +381,7 @@

SearchableMap/SearchableMap.js


- Documentation generated by JSDoc 3.6.4 on Mon Jul 13 2020 11:17:06 GMT+0200 (Central European Summer Time) using the docdash theme. + Documentation generated by JSDoc 3.6.4 on Mon Jul 13 2020 11:23:16 GMT+0200 (Central European Summer Time) using the docdash theme.
diff --git a/docs/index.html b/docs/index.html index 16a2a005..0f94db97 100644 --- a/docs/index.html +++ b/docs/index.html @@ -334,7 +334,7 @@

Contributing


- Documentation generated by JSDoc 3.6.4 on Mon Jul 13 2020 11:17:06 GMT+0200 (Central European Summer Time) using the docdash theme. + Documentation generated by JSDoc 3.6.4 on Mon Jul 13 2020 11:23:16 GMT+0200 (Central European Summer Time) using the docdash theme.
diff --git a/src/MiniSearch.js b/src/MiniSearch.js index 2187e3cd..351f1236 100644 --- a/src/MiniSearch.js +++ b/src/MiniSearch.js @@ -496,16 +496,11 @@ class MiniSearch { * // If the index was serialized with: * let miniSearch = new MiniSearch({ fields: ['title', 'text'] }) * miniSearch.addAll(documents) + * * const json = JSON.stringify(miniSearch) * // It can later be deserialized like this: * miniSearch = MiniSearch.loadJSON(json, { fields: ['title', 'text'] }) * - * **Warning:** JSON (de)serialization of the index is currently tightly - * coupled to the index implementation. For this reason, the current - * implementation is to be considered a _beta_ feature, subject to breaking - * changes changes in future releases. If a breaking change is introduced, - * though, it will be properly reported in the changelog. - * * @param {string} json - JSON-serialized index * @param {Object} options - configuration options, same as the constructor * @return {MiniSearch} an instance of MiniSearch @@ -625,23 +620,20 @@ class MiniSearch { * Allows serialization of the index to JSON, to possibly store it and later * deserialize it with `MiniSearch.loadJSON`. * - * Normally one does not directly call this method, but rather call - * the standard JavaScript `JSON.stringify()` passing the `MiniSearch` - * instance, and JavaScript will internally call this method: + * Normally one does not directly call this method, but rather call the + * standard JavaScript `JSON.stringify()` passing the `MiniSearch` instance, + * and JavaScript will internally call this method. Upon deserialization, one + * must pass to `loadJSON` the same options used to create the original + * instance that was serialized. * * @example * // Serialize the index: * let miniSearch = new MiniSearch({ fields: ['title', 'text'] }) * miniSearch.addAll(documents) * const json = JSON.stringify(miniSearch) - * // Later, to deserialize: - * miniSearch = MiniSearch.loadJSON(json, { fields: ['title', 'text'] }) * - * **Warning:** JSON (de)serialization of the index is currently tightly - * coupled to the index implementation. For this reason, the current - * implementation is to be considered a _beta_ feature, subject to breaking - * changes changes in future releases. If a breaking change is introduced, - * though, it will be reported in the changelog. + * // Later, to deserialize it: + * miniSearch = MiniSearch.loadJSON(json, { fields: ['title', 'text'] }) * * @return {Object} the serializeable representation of the search index */