search scope and vortex

penny
Posts: 11
Joined: Tue May 29, 2001 2:15 pm

search scope and vortex

Post by penny »

Seems like when I think I know how this is going to work, something happens that's different from what I expect!

I have a search script that uses the $path variable to limit the scope of the results by exporting $path at the top of the script. However, the showform section doesn't propagate the path for people who want to search again. So, I added,

<input type=hidden name=path value="$path">

right after the first <TD> tag in this:

<TR><TH ALIGN=RIGHT><FS>Search for this:</TD><TD><INPUT SIZE=20 name=query value="$query"><INPUT TYPE=submit name=submit VALUE="Submit"><input type=submit name=cmd valie="Advanced"></TD></TR>

I also kept the original line, without the $path definition, changing the text to "Search entire site"

During testing, I got the two search boxes as expected, but BOTH limited the search results to the specified path. I would expect the original line to search the entire site, as it did before I made this change.

What's going on?

Thanks in advance.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

search scope and vortex

Post by mark »

"lines" are not special in HTML forms. Everything on the form is sent back to the server when the user hits submit. In vortex the special variable name "cmd" can be used on submit buttons to get it to enter at the named function instead of the default of "main". If you give your "Search entire site" button the name "cmd" and create a function in the search script called "Search entire site" pressing that button will go to the new function. Then that function should set path to empty and then call main
<a name="Search entire site">
<$path=>
<main>
</a>

The other way to handle it would be to use a select list instead of a hidden input separate button. The select would be called path. The entire site option would have a value of "" and the section option would have the path value you have now.
penny
Posts: 11
Joined: Tue May 29, 2001 2:15 pm

search scope and vortex

Post by penny »

Ok. Both search boxes were in the same <form></form>.

Is it possible to specify more than one path? We have virtual hosts set up for some of our directories. The search index contains references to the virtual host and to the directory.

I want to limit the search scope to their directory. Is there a way to specify two paths?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

search scope and vortex

Post by mark »

You've lost me. If you want to search a single subsite of your index why do you need multiple paths?

You can code the SQL query to "or" together your multiple path comparison clauses.
penny
Posts: 11
Joined: Tue May 29, 2001 2:15 pm

search scope and vortex

Post by penny »

Hopefully this will explain it better. The directory www.site.com/department/ has a virtual host www.dept.site.com/. I did a gw -st to find urls containing www.site.com/department/ and www.dept.site.com/, and found both in the index.

I want the search with limited scope to find the urls for that department, regardless of what the path is.

We want the various departments to be able to create their own searches, so $path is defined in the html form that calls texis/webinator/search/. My knowledge of html tells me that the following won't work:

<input type=hidden name="path" value="www.site.com/department/" value="www.dept.site.com">

Rather, a $path2 variable needs to be defined, and the SQL "or" needs to be in the vortex search script.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

search scope and vortex

Post by mark »

You are correct in your last statement about path2.

If www.dept.site.com is just an alias for the same content under www.site.com/department/ you might consider walking it just one way or the other rather than having the confusing variation in the database.
penny
Posts: 11
Joined: Tue May 29, 2001 2:15 pm

search scope and vortex

Post by penny »

User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

search scope and vortex

Post by mark »