Skip to main content.
home | support | download

Back to List Archive

[swish-e] Using ExtractPath to Exclude Some Subdirectory from Search Result

From: Ronny Rahardjo <rrahardjo(at)not-real.gmail.com>
Date: Thu Sep 17 2009 - 07:09:13 GMT
Hi All,

I am new to swish-e. It has been installed and running on our production
environment. We are trying to exclude some of the subdirectory file from the
search result.

Currently, the search result can be:

www.domainname.com/tech/index.php
www.domainname.com/news/index.php?tab=1

sometime also, it can be:

www.domainname.com//tech/index.php (as you noticed, it has extra '/')

My question is how to eliminate searching the tab=1 subdirectory? We just
need to search for tech or news, but not tab=1. Also, do you know what my
cause the extra '/'.

I learned that we can use EXTRACTPATH to do this, but I always get HTTP 500
Internal Server error everytime I modified the swish.conf file to include
the EXTRACTPATH script.

FYI, I just put EXTRACTPATH script on the swish.conf file. Let me know if I
should put in different file as well. Here is my code in swish.conf.

# On metagroups, I added exclusion metaname
meta_groups => {
            all =>  [qw/swishdefault swishtitle swishdocpath exclusion/],
        },

# On metanames, I added exclusion
metanames       => [qw/ swishdefault exclusion/],

# On Xselect, I added metaname: exclusion. Then the following is my
EXTRACTPATH
Xselect_by_meta  => {
            #method      => 'radio_group',  # pick: radio_group, popup_menu,
or checkbox_group
            method      => 'checkbox_group',
            #method      => 'popup_menu',
            columns     => 3,
            metaname    => 'exclusion',     # Can't be a metaname used
elsewhere!
            values      => [qw/misc mod vhosts other no/],
            labels  => {
                misc    => 'General Apache docs',
                mod     => 'Apache Modules',
                vhosts  => 'Virtual hosts',
  no  => 'Exclude',
            },
            description => 'Limit search to these areas: ',
        },

# Basically now I just want to search in particular sub directory: news,
tech, etc.
ExtractPath forum regex !^.*/([^/]+)/.*$!$1!

Let me know if you need more information. Thanks.


_______________________________________________
Users mailing list
Users@lists.swish-e.org
http://lists.swish-e.org/listinfo/users
Received on Thu Sep 17 03:09:17 2009