Sign in to follow this  

[web] searching html pages

This topic is 4661 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi everyone i have done a tutorial using html.This tutorial has many pages and many topics. now i want to include search options in my program so that a person who wants to read about certain topic can type it and search for it ,my program should list all the pages related to the keywords he has given. can anyone help me and tell me how can i include this search option? thank u in advance.

Share this post


Link to post
Share on other sites
Are you thinking about something like the article search on this site? I think you should look into the google search tech, that is pretty popular. Ive never used this, so I am not sure if you need a database or what.

But if worse comes to worse, you could make anchor tags to each important part at the top of the page. Not terribly elegant, but whatever works.

Share this post


Link to post
Share on other sites
Quote:
Original post by ballacki have done a tutorial using html.This tutorial has many pages and many topics.
now i want to include search options in my program so that a person who wants to read about certain topic can type it and search for it ,my program should list all the pages related to the keywords he has given.

can anyone help me and tell me how can i include this search option?


If you can wait for Google to index it, you can just add a Google search bar to your site that only returns results for your site. That's the easy way, and probably the best. Otherwise you could attempt to set up some other search engine system such as Apache Lucene.

Share this post


Link to post
Share on other sites
thank you all for replying,

i am using a scripting language.

i am doing this tutorial as a project.and i want to write the search engine myself.

is there any way using scripting language i can process the html tags.

for eg: can i read what's in the META tag and list that page if it matches
the user's text.

Share this post


Link to post
Share on other sites
html is a markup language.
You cannot search in html.

javascript + vbscript == You can search.

Go and make up an index table, with rankings (how often there used) ("Index.html COntains word "The", ranking 7)

You then go and per word (and modifyer).
If its just a word on its own, assume its and.
+ = And
- = not
| = or

This is for a simplish system (you can get much simler and much more complex).

On the first word, look up in the index table, and mark an array with which pages have the words (you have an array which is your indexes, as well as a second aray which runs this. marking = Turning the bool to true).

When you hit an or, you go and you mark each page that is on the one following.

When you hit and, then you remove marks that are not common, to the array already there, and to the next words's index.

When you hit not, then for that words index, where the index is marked, you unmark it.

Now you find all the marked words, and you shove them in an array, sorted by ranking. You then go and process this (make it look 'nice') before giving it to the user.

Its a little hard to explain. Then again..... i'm not particularly good at explaining when i'm like this, arn't i?

Its better if you have one copy of it, then you load each page with a tag like &;lthscript language="vbscript" src="Search.vbs" /&;gth

In each page, so you go and you change search.vbs once when you add a new page.

From,
Nice coder
From,
Nice coder

Share this post


Link to post
Share on other sites

This topic is 4661 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this