javascript - 什么是 Fuse JavaScript search() 函数在数组上的 Big-O,由 Order 对象组成。请参阅下面的订单对象
问题描述
我试图弄清楚使用 fuse.js 的 Big-O 分析,它使用模糊搜索来查找数据。我计划允许使用搜索订单;order_id、customerName 或 orderDate。
export const orderData = [
{
order_id: '20180101203000',
orderDate: '2018-01-01:20:30:00',
orderStatus: 'Pending',
customerId: 1,
customerName: 'Mbami Luka',
customerCity: 'New York',
customerState: 'New York',
customerCountry: 'USA',
customerPhone: '+1-212-555-1212',
org_id: 'DANDL3ION',
org_name: 'Dandelion',
orderTotal: '$1,000.00',
orderItems: [
{
productId: 1,
productName: 'Pasta',
productSKU: 'SKU-001',
productPrice: '$5.00',
productQuantity: 1,
productTotal: '$5.00',
prodictImage: 'https://www.pexels.com/photo/food-plate-dinner-lunch-5807019/'
},
{
productId: 2,
productName: 'Kebab',
productSKU: 'SKU-002',
productPrice: '$10.00',
productQuantity: 1,
productTotal: '$10.00',
prodictImage: 'https://www.pexels.com/photo/food-dinner-lunch-meal-5191852/'
},
],
},
{
order_id: '20180101203003',
orderDate: '2018-01-01:20:30:03',
orderStatus: 'Pending',
customerId: 1,
customerName: 'Bradley Isaacs',
customerCity: 'New York',
customerState: 'New York',
customerCountry: 'USA',
customerPhone: '+1-212-555-1212',
org_id: 'MSUDENVER',
org_name: 'Dandelion',
orderTotal: '$1,000.00',
orderItems: [
{
id: 3,
productId: 3,
productName: 'Pizza',
productSKU: 'SKU-003',
productPrice: '$15.00',
productQuantity: 1,
productTotal: '$5.00',
prodictImage: 'https://www.pexels.com/photo/pizza-with-red-pepper-and-cheese-1049620/',
},
{
id: 4,
productId: 4,
productName: 'Apple pie',
productSKU: 'SKU-004',
productPrice: '$10.00',
productQuantity: 1,
productTotal: '$10.00',
prodictImage: 'https://www.pexels.com/photo/deliciously-baked-apple-pie-7790871/',
},
],
},
解决方案
推荐阅读
- google-apis-explorer - Google People API listDirectoryPeople 未返回目录中任何用户的姓名
- javascript - 使用 webpack/react 导入问题
- kubernetes - Kubernetes:如何在 pod nodeAffinity 中使用 Gt 运算符
- python - 在Python中循环检查字符串中的字母
- origen-sdk - 在 Flow.create {} 中调用接口
- python - Dockerfile python无法打开文件
- django - 如何在 Django 中为整个页面创建类似管理员的外观?
- java - 如何仅记录部分异常?
- google-apps-script - 如何创建记录开始和结束时间数据的脚本
- javascript - 得到承诺的总和