mirror of
https://github.com/nextapps-de/flexsearch.git
synced 2025-09-02 10:23:50 +02:00
made JSON serializing for import/export optional
This commit is contained in:
@@ -2255,7 +2255,7 @@
|
||||
* @export
|
||||
*/
|
||||
|
||||
FlexSearch.prototype.export = function(){
|
||||
FlexSearch.prototype.export = function(serialize = true){
|
||||
|
||||
let payload;
|
||||
|
||||
@@ -2290,16 +2290,22 @@
|
||||
];
|
||||
}
|
||||
|
||||
return JSON.stringify(payload);
|
||||
if(serialize) {
|
||||
payload = JSON.stringify(payload);
|
||||
}
|
||||
|
||||
return payload;
|
||||
};
|
||||
|
||||
/**
|
||||
* @export
|
||||
*/
|
||||
|
||||
FlexSearch.prototype.import = function(payload){
|
||||
FlexSearch.prototype.import = function(payload, serialized = true){
|
||||
|
||||
if(serialized) {
|
||||
payload = JSON.parse(payload);
|
||||
}
|
||||
|
||||
const ids = create_object();
|
||||
|
||||
|
Reference in New Issue
Block a user