Skip to main content.
home | support | download

Back to List Archive

RE:

From: Bill Pavich <BPavich(at)not-real.nctimes.com>
Date: Mon Mar 15 2004 - 17:27:29 GMT
>> Hello Bill.
>> Yes, I'm running the latest swish-e on a sun box. I'm using it for 
>> local file indexing only and it works great. I am trying to hack 
>> swish.cgi to take two command line arguments.
>> 
>>   Arg[0] = "/path/to/index/file"
>>   Arg[1] = "full search arguments for swish-e"

>swish.cgi is a CGI script.  So how would would those arguments get set?

Yes, I know. You can simply use href html tags like so with the index
predefined and search terms predefined on the command line:

<a
href=/cgi-bin/swish-quick.cgi%20\"/opt/swish-index/swish031104.index\"%2
0\"weather page pubdate=031504\">Weather Page for March 15, 2004</a>

Then, in swish-quick.cgi:

My $indexargument = $ARGV[0];
My $searchstringargument = $ARGV[1];

Set swish_index => $indexargument
Then, in run_swish force the query to use $searchstringargument.


I don't know, that's as far as I'm getting. The command line arguments
pass and display just fine with debugging statements, but when I run it
like that, all I get, outside of my debugging statements verifying that
indexargument and searchstringargument are passing the correct
information is just the initial template which displays the form to
enter a search term and hit the search button. I am trying to get the
template to realize that it already has search results and to just
display them. 

Am I just way off on this, or does that sound like something that's
doable?
Thanks.





> I'm just not a perl guy, so I'm struggling hacking swish.cgi to take 
> these arguments and return the results. I'm setup for using 
> SWISH::TemplateToolkit. I'm trying to create links for some "quick 
> searches" on my indexes. You know, searches that 90% of folks will 
> run. So, to save them from setting up the search, I just wanted to use

> a clickable href link they could just click on. I have about 6 or so 
> of these really commonly used searches. Now, the main search system 
> uses swish.cgi and TemplateToolkit and works really well.

If all you want is some pre-defiend links then setup the hrefs as
needed.  Do the search manually then copy-n-paste the URL shown on the
search results page to your hrefs (escaping as needed ( e.g. & => &amp;
).

-- 
Bill Moseley
moseley@hank.org
Received on Mon Mar 15 09:27:29 2004