Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Strange search results / problems

(Page 1 of 2)
> >
Quote Reply
Strange search results / problems
Hello everyone!

I'll try to be brief and concise:

In the database, among all the others, I have 3 fields:

Location
Type_of_accommodation
Additional_Data

Column Type: CHAR
Column Index: None
Column Size: 255
Form Type: CHECKBOX

and for all links:

Indexing Scheme: INTERNAL

Now, ...

When in my admin section I search for "Air conditioning" and "Internet access" in "Additional_Data" I get 95 results, but ...

When I do the same with search.cgi I get no result ?!?

I get some results if I'm looking for something else but generally the number of results differs from what I get in the administrative area and generally it does not corresponds to the reality.

Does anybody have an idea of what is the problem here?

Many thanks in advance.
Quote Reply
Re: [katakombe] Strange search results / problems In reply to
Have the Additional_Data field set to be indexed? (it needs to be indexed, otherwise it won't search it). It should be setup a bit like the Description field.

I believe the admin panel doesn't do internal indexing (only the mySQL table indexing), which may be why you're seeing different results than you are in the user CGI's

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Strange search results / problems In reply to
Hello Andy!

Please take a look on the image ...

Thanks ...
Quote Reply
Re: [katakombe] Strange search results / problems In reply to
Hi Katakombe,

In order for fields to be searchable from the user you have to give them search weight or else GLinks just don't bothers to search on those fields!

Look at the documentation on that and how the search weights are defined in the default fields in Links table.

Hope that helps.

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [katakombe] Strange search results / problems In reply to
Column Index => None
Search Weight => empty

Both those need setting :)

Also - when you search, are you doing

Additional_Data=1, or Additional_Data=Access%20for%20disabled

If you are using numbers for that field, I would also suggest changing it into an INT (as CHAR isn't needed in this case).

From memory, you need to use the VALUE thats actually saved in the DB... so doing this should work:

?Additional_Data=1;query=*

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [eupos] Strange search results / problems In reply to
Hi,

Boris - It should actually, assuming you are passing in a specific value for it... so something like:

search.cgi?Field=foo;query=*

Or:

search.cgi?Field=foo;field-opt=like;query=*

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Strange search results / problems In reply to
Hi Any!

If I change from "None" to "Regular" do I risk any lost of data?

Thanks ..
Quote Reply
Re: [katakombe] Strange search results / problems In reply to
Hi,

You shouldn't do - but its always worth doing a backup of your DB before doing changes like that... just in case Whistle

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Strange search results / problems In reply to
Hi Andy,

Yes it should ... but only if the options are explicitly set to search on the specific field, the regular search routine would not bother to search in fields without search weight when Internal scheme is used!

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [Andy] Strange search results / problems In reply to
Quote:
A column must be defined as not null if you want to index it.

but I can't have it like that because it is optional for users to use it ..

Any other idea?
Quote Reply
Re: [eupos] Strange search results / problems In reply to
eupos wrote:
Hi Andy,

Yes it should ... but only if the options are explicitly set to search on the specific field, the regular search routine would not bother to search in fields without search weight when Internal scheme is used!

I know (see my first post). I was just saying, that if you *explicity* pass in a value for that field, then it will search Angelic

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [katakombe] Strange search results / problems In reply to
Hi katakombe,

I'd be careful with the indexes as having too many indexes would actually slow your database.

My advice is to play a bit with the search weights and reindex after each change.

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [katakombe] Strange search results / problems In reply to
Hi,

Try just setting it as not indexed then. Alternatively, make the change in phpMyAdmin, and do a "resync". There is an annoying bug where it gives you this message, even when its not true (for never version of mySQL). Its quite ok to have a field with no value, but still have it indexed.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Strange search results / problems In reply to
Additional_Data=1 is right in my case, kind of /cgi-bin/search.cgi?query=&Additional_Data=2&Additional_Data=9
Quote Reply
Re: [katakombe] Strange search results / problems In reply to
Everything is quite confusing right now ...
Quote Reply
Re: [katakombe] Strange search results / problems In reply to
But what if I change from CHAR to INT? Do I risk any lost ... ?
Quote Reply
Re: [katakombe] Strange search results / problems In reply to
katakombe wrote:
But what if I change from CHAR to INT? Do I risk any lost ... ?

Try doing this query first:

Quote:
SELECT DISTINCT(Additional_Data) FROM glinks_Links;

This will show you what values you have in that field. If you only have numbers in it, then changing to an INT will have no problems at all. If you have some with text in, then you would need to update those links (they wouldn't be working right with your current setup anyway, as you are using numbers for DB values)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Strange search results / problems In reply to
Hello Again Andy!

Please look at the PDF file for output ...

Anyway, I'm not sure ... I think that I have lost once a quite part of my database like that ...

Do you want to look from Admin?
Quote Reply
Re: [katakombe] Strange search results / problems In reply to
Hi,

Ah ok, actually you can't use INT for your values. I thought this was a basic SELECT box, but its actually a multi-select (in "checkbox" form). In that case, you do need CHAR.

As Boris said, try tweaking the "search weight" and then re-index and test it. If you would prefer me to have a look, email over GLinks admin logins, and I'll take a look when I get a chance (give me some example queries you would expect to work as well :))

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Strange search results / problems In reply to
OK, thanks, PM sent.
Quote Reply
Re: [katakombe] Strange search results / problems In reply to
Hmmm ... check the output.pdf file again:

Are results sorted alphabetically there ?!?

I don't know, but as I said everything is quite confusing ... 96 results in Admin area but 0 results through search.cgi ...
Quote Reply
Re: [katakombe] Strange search results / problems In reply to
Hi,

That is the correct ordering for a CHAR field. If you were using an INT, it would be going 1,2,3,4,5 etc... but because you're using a CHAR, it doesn't sort numerically as you would expect... it would go:

1,10,11,12,13,14,15,16,17,18,19,2,20,21,22,23 etc

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Strange search results / problems In reply to
Yea, you are right Smile
Quote Reply
Re: [katakombe] Strange search results / problems In reply to
Hi,

Ok, so after doing some debugging it seems there is a problem with the selecting of multiple "checkbox" / "multi-select" values from the user side. An example using search.cgi:

Code:
SELECT * FROM glinks_Links WHERE (TestCheckbox IN ('btest','atest') AND isValidated = 'Yes') LIMIT 0, 25

That won't give a result, as the value in that field is just:

Code:
atest
btest

When run in the admin panel, it does it differently:

Code:
Executing query: SELECT * FROM glinks_Links WHERE (TestCheckbox LIKE '%atest\t%btest%') LIMIT 0, 25

I'm not really sure of the cause of this, but thought I'd post it here, as it appears to be a bug

FWIW, simply doing:

search.cgi?query=;TestCheckbox=xxx works fine... cos its only looking for one value (doesn't need to do an IN in that case, its its only gotta match one criteria)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Strange search results / problems In reply to
HI,

Has there been any progress from the GT team about this issue?

Regards
> >