@xuda.io/drive_module 1.1.854 → 1.1.856
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/index.js +21 -15
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1728,30 +1728,36 @@ exports.search_drive_files = async function (req) {
|
|
|
1728
1728
|
let tags_query = search_string
|
|
1729
1729
|
.split(" ")
|
|
1730
1730
|
.filter((e) => e.includes(":"))
|
|
1731
|
-
.reduce(
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
if (
|
|
1739
|
-
|
|
1731
|
+
.reduce(
|
|
1732
|
+
(ret, val) => {
|
|
1733
|
+
var tagKey = val.split(":")[0];
|
|
1734
|
+
var tagVal = val.split(":")[1];
|
|
1735
|
+
|
|
1736
|
+
// if (!ret[tagKey]) ret[tagKey] = [];
|
|
1737
|
+
|
|
1738
|
+
if (tagVal) {
|
|
1739
|
+
if (tagKey === "tags") {
|
|
1740
|
+
ret["$or"].push({ [tagKey]: { $in: tagVal } });
|
|
1741
|
+
} else {
|
|
1742
|
+
ret["$or"].push({ [tagKey]: { $regex: tagVal } });
|
|
1743
|
+
}
|
|
1740
1744
|
} else {
|
|
1741
|
-
|
|
1745
|
+
og_search += og_search;
|
|
1742
1746
|
}
|
|
1743
|
-
} else {
|
|
1744
|
-
og_search += og_search;
|
|
1745
|
-
}
|
|
1746
1747
|
|
|
1747
|
-
|
|
1748
|
-
|
|
1748
|
+
return ret;
|
|
1749
|
+
},
|
|
1750
|
+
{
|
|
1751
|
+
$or: [],
|
|
1752
|
+
}
|
|
1753
|
+
);
|
|
1749
1754
|
|
|
1750
1755
|
var new_search = search_string
|
|
1751
1756
|
.split(" ")
|
|
1752
1757
|
.filter((e) => !e.includes(":"))
|
|
1753
1758
|
.filter((e) => e)
|
|
1754
1759
|
.join(" ");
|
|
1760
|
+
|
|
1755
1761
|
tags_query.$or = [
|
|
1756
1762
|
{
|
|
1757
1763
|
ocr: {
|