i have web app pos the array filter search in client side in browser not in the server first i download all products as array and work on it and its working so good with number of products under 20k since a while the array of the products get the number of 50k
and my results array like this ..
[
{
"id": 1,
"name": "Product 1",
"number": "1",
"available_on_pos": 1,
"pos_quick_lunch": 1,
"product_category_id": 1,
"discount_value": 10,
"smallest_unit_id": 1,
"smallest_unit_barcode": null,
"smallest_unit_selling_price": 10,
"smallest_unit_selling_price_above": null,
"smallest_unit_selling_price_above_price": null,
"tax_value": 16,
"get_smallest_unit_id": {
"id": 1,
"name": "Unit"
},
"get_price_list_lines": []
},
{
"id": 13,
"name": "Product 2",
"number": "13",
"available_on_pos": 1,
"pos_quick_lunch": null,
"product_category_id": 1,
"discount_value": null,
"smallest_unit_id": 1,
"smallest_unit_barcode": "9501025172815",
"smallest_unit_selling_price": 0.509,
"smallest_unit_selling_price_above": null,
"smallest_unit_selling_price_above_price": null,
"tax_value": 16,
"get_smallest_unit_id": {
"id": 1,
"name": "Unit"
},
"get_price_list_lines": []
}
]
and this is the search method
var results = this.products.filter(obj => obj.smallest_unit_barcode != null && obj.smallest_unit_barcode.includes(value));
this.pos_quick_lunch = results;
as i say the the products array is 50k the search like have delay when i press barcode gun multiable time at same product search and this is long time in pos to wait .. is there any way thats i can make the search much easer and faster