Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Search.cgi bug?

Quote Reply
Search.cgi bug?
Hello all,

Why when my search query contains capital letters it doesn't found correctly? F.e. i write 'art', it returns result, and if i write 'Art', it returns nothing...

I've added
$args->{query} = lc ($args->{query});
in Search.pm at 85 string and now it works.

Is it a bug or feature Wink?

Anton Permyakov.
Quote Reply
Re: [Anton_P] Search.cgi bug? In reply to
Quote:
I've added
$args->{query} = lc ($args->{query});

What if the resource you were looking for contained the word Art Angelic
Quote Reply
Re: [Anton_P] Search.cgi bug? In reply to
Hi Anton,

What SQL server are you using? MySQL does case insensitive matches on char fields, so lc'ing it should not matter.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Search.cgi bug? In reply to
I use Oracle 8i.

Now i know - it is the reason for search.cgi bugs...

Also there are many others bugs with search in Oracle :((
Should I mention them?
F.e. : i enter query "gram", substirng, it doesn't return "Programm ...", and there are many other bugs :((

Anton
Quote Reply
Re: [Anton_P] Search.cgi bug? In reply to
I change type of search to "regular" from "indexed", and now i get following error:

A fatal error has occured:

Unable to query database: Failed to prepare query: 'SELECT * FROM wdCategory WHERE ( ( ( Description LIKE '%graph%' OR Name LIKE '%graph%' ) ) )
' Reason: ORA-00932: inconsistent datatypes (DBD ERROR: OCIStmtExecute/Describe) at /www/docs/lib/linkssql/admin/Links/User/Search.pm line 244.

Please enable debugging in setup for more details.

Stack Trace
======================================
Links (25695): Links::environment called at /www/docs/lib/linkssql/admin/Links.pm line 487 with no arguments.Links (25695): Links::fatal called at /www/docs/lib/linkssql/admin/Links/User/Search.pm line 244 with arguments (Unable to query database: Failed to prepare query: 'SELECT * FROM wdCategory WHERE ( ( ( Description LIKE '%graph%' OR Name LIKE '%graph%' ) ) )
' Reason: ORA-00932: inconsistent datatypes (DBD ERROR: OCIStmtExecute/Describe) at /www/docs/lib/linkssql/admin/Links/User/Search.pm line 244.
).Links (25695): Links::User::Search::_query_ni called at /www/docs/lib/linkssql/admin/Links/User/Search.pm line 125 with arguments (Links::Category=HASH(0x84b839c), Links::Link=HASH(0x8426a28), HASH(0x844beb8)).Links (25695): Links::User::Search::query called at /www/docs/lib/linkssql/admin/GT/Plugins.pm line 98 with arguments (HASH(0x84269d4)).Links (25695): GT::Plugins::dispatch called at /www/docs/lib/linkssql/admin/Links/User/Search.pm line 62 with arguments (GT::Plugins, /www/docs/lib/linkssql/admin/Plugins, search_results, CODE(0x8404750), HASH(0x84269d4)).Links (25695): Links::User::Search::search called at /www/docs/lib/linkssql/admin/Links/User/Search.pm line 44 with no arguments.Links (25695): Links::User::Search::handle called at /www/docs/lib/linkssql/search.cgi line 22 with arguments (Links::User::Search).


I guess, A fatal error has occured:

Unable to query database: Failed to prepare query: 'SELECT * FROM wdCategory WHERE ( ( ( Description LIKE '%graph%' OR Name LIKE '%graph%' ) ) )
' Reason: ORA-00932: inconsistent datatypes (DBD ERROR: OCIStmtExecute/Describe) at /www/docs/lib/linkssql/admin/Links/User/Search.pm line 244.

Please enable debugging in setup for more details.

Stack Trace
======================================
Links (25695): Links::environment called at /www/docs/lib/linkssql/admin/Links.pm line 487 with no arguments.Links (25695): Links::fatal called at /www/docs/lib/linkssql/admin/Links/User/Search.pm line 244 with arguments (Unable to query database: Failed to prepare query: 'SELECT * FROM wdCategory WHERE ( ( ( Description LIKE '%graph%' OR Name LIKE '%graph%' ) ) )
' Reason: ORA-00932: inconsistent datatypes (DBD ERROR: OCIStmtExecute/Describe) at /www/docs/lib/linkssql/admin/Links/User/Search.pm line 244.
).Links (25695): Links::User::Search::_query_ni called at /www/docs/lib/linkssql/admin/Links/User/Search.pm line 125 with arguments (Links::Category=HASH(0x84b839c), Links::Link=HASH(0x8426a28), HASH(0x844beb8)).Links (25695): Links::User::Search::query called at /www/docs/lib/linkssql/admin/GT/Plugins.pm line 98 with arguments (HASH(0x84269d4)).Links (25695): GT::Plugins::dispatch called at /www/docs/lib/linkssql/admin/Links/User/Search.pm line 62 with arguments (GT::Plugins, /www/docs/lib/linkssql/admin/Plugins, search_results, CODE(0x8404750), HASH(0x84269d4)).Links (25695): Links::User::Search::search called at /www/docs/lib/linkssql/admin/Links/User/Search.pm line 44 with no arguments.Links (25695): Links::User::Search::handle called at /www/docs/lib/linkssql/search.cgi line 22 with arguments (Links::User::Search).

I guess, the problem is that Oracle cannot use "LIKE" on TEXT-type fields...
What should i do?

Anton Permyakov
Quote Reply
Re: [Anton_P] Search.cgi bug? In reply to
Hi,

We will fix up the lower case issue.

The substring is like that by design. Substring only does right substring matches, so gram matches gram*. This is because it uses an SQL index to look up it's results, and you can't use an index if your query is '%gram%', only 'gram%'.

As mentioned in email, the regular search won't work as Oracle can not do '%term%' on text (clob) fields. I'd be happy to work with you to create an interface to use Oracle's full text indexing if you are familiar with it.

Cheers,

Alex
--
Gossamer Threads Inc.