We help IT Professionals succeed at work.

Searchable web page

dpate
dpate asked
on
Medium Priority
253 Views
Last Modified: 2013-12-25
I would like to know the specifics involved with setting up a searchable web page.  I have a large list of items and I would ultimately like to provide a text field on one of my pages where viewers can submit a query and search this list of items by product name, description, catalog number, etc.  How is this accomplished?.
Comment
Watch Question

Author

Commented:
Edited text of question
Commented:
What you're trying to write is a pretty simple text-matching program - the function is pretty simple to write using indexOf() to find out if text in the page matches text the user entered to search.

Problem is, the text in the page isn't available to Javascript - to do this, you'll have to put all your text into JavaScript arrays, then document.write() that text into the page.   For each item, document.write('<LI>' + itemname[0] + itemdescription[0]); etc.

Problem with *that* is javascript-disabled users won't be able to see your text.  You may have to create separate pages.  Alternately, you could have redundancy by putting anchors in the page and associating each anchor with keywords that are redundantly available in javascript arrays ...

... but before I lead you too far in the wrong direction, let me suggest using something other than javascript to do this.  Javascript is good for simple operations using a relatively small amount of data, but if you want to use it to search a lengthy list, it's gonna be *slow* (and may crash a few users).  

It would be a *much* better idea to use something a bit more robust - a Perl script or a database, either of which is designed to do the kind of text-matching operations you need quickly, efficiently, and dependably.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
jshamlin:

Thanks for the comments.  Your last suggestion is, for the most part, what I had in mind.  the information would be in the form of a database (most likely MS-Access).  How could I tie the data in such a format into something which is accessible to a viewer of my web site?

dpate

Commented:
Integrating a simple database into a Web site is fairly sophisticated.   Maybe that's an understatement - it's "fairly sophisticated" when everything clicks into place and it runs the first try without any troubleshooting.

If you're using Access and you're hosting on an Internet Information Server, it's a little easier, but still no cake walk - you're going to need to write SQL queries into active server pages or "IDC/HTX" connectors and templates.  (Some folks will try to sell you on a Perl kludge - which will work, but it's cantankerous and not very scalable.)

Anyway, the long answer is a few textbooks on SQL and Web database connectivity, and the short answer is "hire a pro."  A WWW-savvy DBA may charge you a few thousand to hook up a relatively simple database, but if you're talking about a commercial site (you mention "products"), then it'll probably be worth it - if your database isn't fast and reliable, potential customers will look elsewhere.

If you need to go it alone, it'll be tough - there are a few tools out there designed to provide "wizards" or simple, GUI-driven processes for setting up Web databases (Symantec Visual Cafe and Front Page 97 come to mind).  I can't give you any testimonials, though: I've always outsourced database development to a professional DBA.


Author

Commented:
Thanks again for info.  I think I'll take your advice and farm this one out while I still have some hair left.

dpate
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.