bep40 commited on
Commit
49b666f
·
verified ·
1 Parent(s): 8e03e4f

Use advanced context search in chatbox AI for Grob accessory dimensions

Browse files
Files changed (1) hide show
  1. index.html +11 -3
index.html CHANGED
@@ -1602,13 +1602,21 @@ function hideTyping(){let el=document.getElementById('typingIndicator');if(el)el
1602
  // Search products locally
1603
  function searchProducts(query){
1604
  if(!D||!D.length)return[];
 
 
 
 
 
 
 
 
1605
  let q=nVN(query);
1606
  let words=q.split(/\s+/).filter(w=>w.length>1);
1607
  let scored=D.map((p,i)=>{
1608
  let idx=p._idx;
1609
  let score=0;
1610
  words.forEach(w=>{
1611
- if(idx.includes(w))score+=1;
1612
  if(p.name&&nVN(p.name).includes(w))score+=3;
1613
  if(p.cat&&nVN(p.cat).includes(w))score+=2;
1614
  });
@@ -1793,7 +1801,7 @@ THÔNG TIN:
1793
  - 2256 sản phẩm, 5 thương hiệu: Malloca, Eurogold, Grob, Canzy, Demax
1794
  - Malloca: thiết bị bếp cao cấp châu Âu
1795
  - Eurogold: phụ kiện tủ bếp inox 304
1796
- - Grob: phụ kiện nhập khẩu
1797
  - Canzy: bếp từ, máy hút mùi
1798
  - Demax: khóa cửa thông minh Made in Malaysia
1799
  - Zalo tư vấn: 0981 873 395 (zalo.me/0981873395) hoặc 0918 258 385 (zalo.me/0918258385)`;
@@ -2880,7 +2888,7 @@ Miễn phí giao hàng trong TPHCM. | Giá đã bao gồm VAT.
2880
  </div>
2881
  </div>
2882
  </div>
2883
- <script src="search-plus-boot.js?v=18"></script>
2884
 
2885
  <script>function doAISearch(){
2886
  // Delegated to search-plus-boot.js v15 (ALL-IN-ONE)
 
1602
  // Search products locally
1603
  function searchProducts(query){
1604
  if(!D||!D.length)return[];
1605
+ // Use advanced search-plus-boot.js context search first.
1606
+ // This handles Grob/Eurogold/Garis cabinet accessory dimensions such as: "kệ gia vị 300mm".
1607
+ try{
1608
+ if(window._vaiSearchContext){
1609
+ let advanced=window._vaiSearchContext(query,8).map(x=>x.p).filter(Boolean);
1610
+ if(advanced.length)return advanced;
1611
+ }
1612
+ }catch(e){console.warn('advanced searchProducts failed',e)}
1613
  let q=nVN(query);
1614
  let words=q.split(/\s+/).filter(w=>w.length>1);
1615
  let scored=D.map((p,i)=>{
1616
  let idx=p._idx;
1617
  let score=0;
1618
  words.forEach(w=>{
1619
+ if(idx&&idx.includes(w))score+=1;
1620
  if(p.name&&nVN(p.name).includes(w))score+=3;
1621
  if(p.cat&&nVN(p.cat).includes(w))score+=2;
1622
  });
 
1801
  - 2256 sản phẩm, 5 thương hiệu: Malloca, Eurogold, Grob, Canzy, Demax
1802
  - Malloca: thiết bị bếp cao cấp châu Âu
1803
  - Eurogold: phụ kiện tủ bếp inox 304
1804
+ - Grob: phụ kiện nhập khẩu, ưu tiên tư vấn Grob cho phụ kiện tủ bếp; với kệ/giá gia vị 300mm dùng kết quả tìm kiếm nâng cao từ web
1805
  - Canzy: bếp từ, máy hút mùi
1806
  - Demax: khóa cửa thông minh Made in Malaysia
1807
  - Zalo tư vấn: 0981 873 395 (zalo.me/0981873395) hoặc 0918 258 385 (zalo.me/0918258385)`;
 
2888
  </div>
2889
  </div>
2890
  </div>
2891
+ <script src="search-plus-boot.js?v=19"></script>
2892
 
2893
  <script>function doAISearch(){
2894
  // Delegated to search-plus-boot.js v15 (ALL-IN-ONE)