linear search

Post Reply
hess
Posts: 7
Joined: Fri Dec 21, 2001 10:21 am

linear search

Post by hess »

Hi!
I'm using the freeware version of Webinator 4. We were previously using the freeware Webinator version 2. We have some perl scripts which used the gw on the old webinator db. I'm attempting to rework the scripts to be used on the webinator 4 db using texis.

One of the queries on the db is following:
texis -d /WWW/webinator/texis/eob/db2 -s "select Url from html where Url like 'WarmPool' order by Url"

The result of this query is:

115 Query 'WarmPool' would require linear search

Now I've read in previous posts that linear searching is disabled in Vortex by default and that you have to turn it on by issuing the command: <apicp alllinear on>

My question is: where does one do this? in the cgi perl script? A config file? Is it allowed in the freeware version?

Second question: if I want to include the -h option in the above query (preventing column headings to be printed in the output) where would I put it? All permutations I've tried have issued errors. -sh "select ...."
-s-h "select ...." -s "select...." -h

Thanks in advance for your help!
-Tara
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

linear search

Post by Kai »

The texis program takes different command-line arguments than gw, as it has a different primary function (running any Vortex script vs. indexing a site). Run texis without any args and you'll see a summary. Use -h to suppress column headings.

As for linear searching, since you can only do one SQL statement on the command line with texis, you'll need to write a short Vortex script to do the query. Something like this:

<script language=vortex>
<a name=main>
<apicp allinear on>
<sql row "select Url from html where Url like $query order by Url">
$Url
</sql>
</a>
</script>

Then call it like this:

texis -d /path/to/db query="WarmPool" myscript/main.txt
hess
Posts: 7
Joined: Fri Dec 21, 2001 10:21 am

linear search

Post by hess »

Thanks for your quick reply!

I created a myscript almost exactly like you wrote up. I did add a <db = "/WWW/webinator/texis/eob/db2">

When I ran it from the command line I received the output I anticipated. I set up a test script which basically contains what I was running from the command line.

here's the meat of it:

my $story = "WarmPool";
my $url;
my @allurls = ('/WWW/cgi-bin/texis -d /WWW/webinator/texis/eob/db2 query=\"$story\" /WWW/cgi-bin/myscript');

foreach $url (@allurls) {
print $url;
}

When I run this, I get a 015 Incorrect host setup

What's going on with that?

Thanks for any help you can provide. I really do appreciate it.

Tara
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

linear search

Post by Kai »

The texis executable generally cannot be exec'd from some environments such as Perl. If you are running this on a list of values, it's more efficient to read and run the query in Vortex than to exec a new copy each time. If your queries are one per line in a file, then just add a <readln> loop:

<readln row "myqueryfile">
<$query = $ret>
Querying for $query:
<sql "select Url from html where Url like $query order by Url">
$Url
</sql>
</readln>
hess
Posts: 7
Joined: Fri Dec 21, 2001 10:21 am

linear search

Post by hess »

Hey Kai-

This is a "printall" script and here's what it really does: it gets the document_uri environmental variable from the page where the script was executed. It then goes through a whole mess of regular expressions to get the document_uri to the $story variable form (like in the test script $story="WarmPool"). Using the $story variable, we search the webinator db to find all the URLs that match that pattern. The results are then used to shove the multiple pages together so that you can print the an entire article rather than each of its pages.

So is there anyway to make the texis part communicate with the perl parts?

Again, thanks for your help.
-Tara
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

linear search

Post by mark »

Sounds like something that can be done entirely in vortex. A couple of <rex>'s then a search and display all in one efficient script.
Post Reply