Jump to content
Froman

Live Search - Over 40,000 Records

Recommended Posts

I've built a static site with over 40,000 pages using Jekyll.  I am trying to implement a live search into it without a database.  I tried the w3schools live search example with a xml file I created from my site.  It is very slow.  

Does anyone know of a faster way to parse xml files or am I wasting time.  I enabled gzip compression on the entire site also,  

What  would be the fastest way to search a lot of records and return a result?

Thanks in advance.

Share this post


Link to post
Share on other sites

There is no fast way to search an XML document, because the entire file needs to be loaded into memory and parsed before the search can even begin. You would need to create a file format that is optimized for searching, which is exactly what databases do.

The search has to be done on the server-side as well, since transferring 40,000 records to the client before beginning the search is already a slow task.

Share this post


Link to post
Share on other sites

Under the assumption that the XML files are uniformly constructed.  Why not construct a table in a database that could accommodate all of the XML items in your files, and then write a PHP routine that would extract the values of each item in each file and insert them into the data table?

I know. I was also very hesitant to start using a database, but I am very glad that I did.  For, it is everything at your fingertips -- anything, anywhere,  anytime, in any order, and as much or as little as you want.

Roddy

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...