Forum Moderators: coopster & phranque

Message Too Old, No Replies

NMS SimpleSearch

No info to be found!

         

fred

5:50 pm on Apr 10, 2007 (gmt 0)

10+ Year Member



Hello everyone,

I can't seem to find any info on this SimpleSearch thing, so maybe it's because I'm about to ask a "101" question... But here goes!

I'm trying to put this SimpleSearch thing in place, and it doesnt return any results. It works (It gives me a result form) but there is nothing on it.

I get the feeling my problem is with the $basedir variable. I entered everything I could think of. It seems pretty straightforward ("the folder beeing searched"):

$basedir = '/public';
$baseurl = 'http://www.example.com/';
@files = ('*.html','*/*.html');
$title = "Search result on Tiger-Vac.com";
$title_url = 'http://www.example.com';
$search_url = 'http://www.example.com/pages/search.html';
@blocked = ();
$emulate_matts_code = 1;
$style = '';
$charset = 'iso-8859-1';

The way I see it, this should search all of the "public" folder? Right?

Thanks in advance for your help, and sorry if I'm duplicating something that already exists, but I couldnt find a thread about this.

[edited by: jatar_k at 8:06 pm (utc) on April 10, 2007]
[edit reason] please use example.com [/edit]

perl_diver

6:53 pm on Apr 10, 2007 (gmt 0)

10+ Year Member



try this:

$basedir = $ENV{DOCUMENT_ROOT};

or:

$basedir = 'full/path/to/public';

fred

8:07 pm on Apr 10, 2007 (gmt 0)

10+ Year Member



The first one works. However, it gives me everything including log files and the likes.

How does it work? What does it mean?

$basedir = $ENV{DOCUMENT_ROOT};

I'm not much of a coder...

Thanks for the help!

perl_diver

11:30 pm on Apr 10, 2007 (gmt 0)

10+ Year Member



perl uses a hash named %ENV which stands for "environment". Perl stores information in that hash for a variety of reassons, but you can also use them directly in your perl programs. DOCUMENT_ROOT is the path to the root www folder of the web server. The root www folder is the top level folder people enter your website from if they do this:

http://www.example.com

maybe you want to do this:

$basedir = "$ENV{DOCUMENT_ROOT}/public";

I assumed 'public' was the www root but maybe not.

See the NMS SimpleSearch readme documentations for details on setting up the script.

fred

12:18 pm on Apr 11, 2007 (gmt 0)

10+ Year Member



Great! Thanks for the explanation.