当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - node.js catalog search implementation

问题描述:

My issue is implement some simple search and dropdown suggestions from my web catalog. Something like that

Now all my items stores in items.xml file , like:

<?xml version="1.0" encoding="UTF-8"?>

<catalog_list>

<catalog change_list="id,parent_id,title" status="new" id="13642">

<id>13642</id>

<parent_id>00001</parent_id>

<title>ITEM1</title>

</catalog>

<catalog change_list="id,parent_id,title" status="new" id="13634">

<id>13634</id>

<parent_id>09851</parent_id>

<title>ITEM2</title>

</catalog>

<catalog change_list="id,parent_id,title" status="new" id="13635">

<id>13635</id>

<parent_id>09851</parent_id>

<title>ITEM3</title>

</catalog>

......

where parent_id key refs to id from description.xml with description of item.

So I think parse all that files to my mongoDB (so I will have two corresponding tables), and use db in my item order page template(request for some fields with images, description , price and etc.) Maybe I am thinking very wrong, pls correct me.

But I dont know what to do with my search implementation, should I make response to my mongoDB every user key press (onkeyUp() event?It seems to me so ugly and slow. Maybe I can use some indexing libs for NODE.JS?

分享给朋友:
您可能感兴趣的文章:
随机阅读: