Gossamer Forum
Home : Products : Links 2.0 : Customization :

HELP ME!, or I lost my job!

Quote Reply
HELP ME!, or I lost my job!
sorry by my english...

I need searching in others fields, example:

query= test
location= Perdizes
payment= Visa
specialit= fast food

all fields have many text, example of register: payment= visa, american express, sollo, ticket

please help Me!

or i have big Problems...

Thank You!

Quote Reply
Re: HELP ME!, or I lost my job! In reply to
Although Links can do this (ie: search.cgi?query=&Title=blah) it will only return exact matches when you search in specific fields. A better solution would be to use DBMAN for searching your database.

--Drew
Quote Reply
Re: HELP ME!, or I lost my job! In reply to
You could also, (in Links 2.0), control which fields are searched by changing @search_fields in links.def.

Eg: if 'query' is field 3, 'location' is field 5 and 'payment' is field 2. You can have the search go through them all by setting @search_fields as follows:-

@search_fields = (2,3,5);

George
Quote Reply
Re: HELP ME!, or I lost my job! In reply to
... or if you want to search specific fields only, you could put the appropriate <input>-tags on your html and in search.cgi, sub search for example something like

# Search specific fields only
my $searchonly = $in{'searchonly'};

if ($searchonly eq "all") {
@search_fields = (1,2,5,14);
}
if ($searchonly eq "title") {
@search_fields = (1);
}
if ($searchonly eq "description") {
@search_fields = (5);
}
if ($searchonly eq "url") {
@search_fields = (2);
}
if ($searchonly eq "stichworte") {
@search_fields = (14);


Denis

Quote Reply
Re: HELP ME!, or I lost my job! In reply to
Thank You for all!

The solutions of the Dennis, is very good, but i have a big problem:

The user need search using 2 or 3 arguments.

Payment=visa
critery=test
othercritery=test2

Any have a solutions..

Thanks for all!!!


Quote Reply
Re: HELP ME!, or I lost my job! In reply to
Probably you're gonna loose your job... Wink

Something like
# Search specific fields only
my $searchonly = $in{'searchonly'};

if ($searchonly eq "all") {
@search_fields = (1,2,5,14);
}
if ($searchonly eq "title") {
push @search_fields, 1;
}
if ($searchonly eq "description") {
push @search_fields, 5;
}
if ($searchonly eq "url") {
push @search_fields, 2;
}
if ($searchonly eq "stichworte") {
push @search_fields, 14;

Test it.
Ciao
Denis

Quote Reply
Re: HELP ME!, or I lost my job! In reply to
Thanks!

We get!

I speking with my boss, and he understand the limitations of the Links 2.0. I put a selector with the filds and use your idea.

Thanks again, for you and for another friends of this forum!!!

[ ]'s

Senger