Forum Moderators: open

Message Too Old, No Replies

An ASP Search Script

a small starting point with about 30 lines

         

cmatcme

7:51 pm on Mar 24, 2005 (gmt 0)

10+ Year Member



Hi I'm looking for resources for a site search engine - nothing major - I'd much rather start off with something small and build on it to customize it.

This time I have found a free host with CreateObject permitted.

mattglet

9:26 pm on Mar 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do a search for Atomz. They provide a free service that should work well for you.

cmatcme

9:35 am on Mar 25, 2005 (gmt 0)

10+ Year Member



Thanks mattglet but from what I've read they host the search for you and I want to have control over what goes on the search. I have gathered a search script which displays the file path and nothing else.

I wish to have a title and description and link.

The command which links to the file path is objFile.Path

Would these commands be correct?

objFile.Title - Title Path
objFile.Description - Description
objFile.Size - Size Of File

Any help would be appreciated.

cmatcme

lovethecoast

10:24 am on Mar 25, 2005 (gmt 0)

10+ Year Member



Do a search on FileSystemObject. You'll see tons of sites with tons of great code covering all details of this control.

cmatcme

11:35 am on Mar 25, 2005 (gmt 0)

10+ Year Member



Thanks lovethecoast. I've managed to get the filesize, location and the last modified date on but I can't find how you'd request the name or description of the page.

My next query is that the filesize appears in bytes (b) but I would it to appear in kilobytes (kb). Anyone know how to multiply the file size by 1000?

Easy_Coder

1:55 pm on Mar 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I can't find how you'd request the name

objFile.Name

or description of the page

You need to open the file to get it's content if you want to bang sometype of query against that data. However, keep in mind that your files could potentially contain server-side code right. So make sure you filter around that code and files like global.asa or you could be opening yourself up for some security issues. Look at the Read...() methods to get the file contents.

You can find 'Working with File' basics regarding the FileSystemObject here:

[msdn.microsoft.com...]

mattglet

2:18 pm on Mar 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What exactly do you mean by "control over the search"? Atomz is super duper customizable, and the last time I looked (it was a while ago, though), they have decent docs.

cmatcme

2:40 pm on Mar 25, 2005 (gmt 0)

10+ Year Member



mattglet//

I don't wish ads to be placed in the engine unless I give the go ahead and I've got a function set out which when user inputs a web address www.example.com it changes the query to http:/./www.example.com (without the dot between the two slashes) and after that redirects the user to that website. This feature I wsh to remain exclusive to members.

cmatcme

aspdaddy

8:31 am on Mar 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



One way is to write a spider script to read all the meta title and descriptions on your pages.

Best to run this script manually every time a page is changed or added to the site rather than every time a user performs a search. You could then store the data in a database or file and/or cache them for better performance.