4images Forum & Community

4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: xico on May 20, 2005, 03:10:03 AM

Title: Searching not working with PHP5
Post by: xico on May 20, 2005, 03:10:03 AM
Is there a bug with PHP5 and searches...? I just install a fresh 4images 1.7.1 and the search can not find any image on the public side but on the admi side it does.

Any clue?

Thanks
Title: Re: Searching not working with PHP5
Post by: V@no on May 20, 2005, 02:37:00 PM
what are searching for?
Title: Re: Searching not working with PHP5
Post by: Chris on May 20, 2005, 02:54:52 PM
How about a link to where this is happening so we can try it out?
Title: Re: Searching not working with PHP5
Post by: xico on May 20, 2005, 04:13:40 PM
Sure.. sorry.. http://200.78.201.39/ there is only one image and the search option does not find it
Title: Re: Searching not working with PHP5
Post by: Chris on May 20, 2005, 04:52:07 PM
Interesting.  I don't think 4images has been adequately tested against PHP 5.  Try the [Plugin] Rebuild Search Index (http://www.4homepages.de/forum/index.php?topic=6718.0) and see if that helps.  Otherwise I have no other ideas
Title: Re: Searching not working with PHP5
Post by: xico on May 20, 2005, 05:36:23 PM
I rebuild the index with the Rebuild Plugin with no successfull :(
Title: Re: Searching not working with PHP5
Post by: V@no on May 21, 2005, 12:01:11 AM
look up in the database. make sure there are some keywords in 4images_keywords table.
Title: Re: Searching not working with PHP5
Post by: V@no on May 21, 2005, 12:04:45 AM
also, a link to your phpinfo could help too ;)
Title: Re: Searching not working with PHP5
Post by: xico on May 21, 2005, 12:36:00 AM
http://200.78.201.39/info.php  :P

And there is words in the word_list table

word_text
word_id
           just   
           flower   
           test   
           image   
           glass   
           soccer   
           two   
           persons   
           and   
           ball   
           person   
Title: Re: Searching not working with PHP5
Post by: xico on May 26, 2005, 05:21:02 PM
Fixed...i move the configuration files in search.php up to the top of the file
Title: Re: Searching not working with PHP5
Post by: teszeract on September 02, 2005, 01:39:24 AM
Fixed...i move the configuration files in search.php up to the top of the file

Hi
Could you explain what you did to fix your problem (for limited knowledge people).
I am encountering the same problem running OS 10.4 on a Mac. No search results although all keywords & descriptions are present.

If the original author is not around, can anyone else point me in the right direction.

By the way, excellent software. I have tried Coppermine, Snipegallery, phpwebgallery and others - and once search is sorted out, I think all will be good.
Title: Re: Searching not working with PHP5
Post by: teszeract on September 02, 2005, 01:50:37 AM
Okay. Me did it too!! :)

the following lines in search.php:
Code: [Select]
$main_template = 'search';

define('GET_CACHES', 1);
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
include(ROOT_PATH.'includes/search_utils.php');

$search_id = array();

cut and paste just below the licensing info. If I'm wrong, please post here.
Title: Re: Searching not working with PHP5
Post by: Q-man on January 18, 2006, 04:56:47 PM
Thats really amazing! 20% of all postet gallery links here have this problem with the search.php...how did you find it out?
It really works...I was really sick about this bug!
Thank you :)
Title: Re: Searching not working with PHP5
Post by: V@no on January 19, 2006, 12:16:13 AM
If you would install all the fixes (especialy security fixes), then you would not have this issue ;)
Title: Re: Searching not working with PHP5
Post by: Q-man on January 19, 2006, 02:42:42 AM
Okay, but for Newbies its not easy to find out how getting started...Three days ago, I installed 4images at the first time and its hard to get started when youŽre not a php crack ;) Maybe in 2 weeks IŽll find it funny, but now Im glad having solved the search problem...
Title: Re: Searching not working with PHP5
Post by: WeZ on August 14, 2006, 11:27:14 PM
V@no,

sorry mate, but which security fix are you talking about?

i only found a search.php fix but it was for 1.7.1 and my 1.7.2 is fine - but then why would i also be experiencing this?

Ciao
Title: Re: Searching not working with PHP5
Post by: V@no on August 15, 2006, 12:24:49 AM
which security fix are you talking about?
All of them. Whatever bug fix is published for your 4images version you should install it.
Title: Re: Searching not working with PHP5
Post by: WeZ on August 15, 2006, 01:58:27 AM
and i will as soon as all my functionality is in order... so right now i need to get to my main prob and that is the search not working which was suggested that it was fixed by a security patch... so please, which one will help me with this php5 prob?

thanks
Title: Re: Searching not working with PHP5
Post by: V@no on August 15, 2006, 04:25:24 AM
I didnt say it was fixed by a security patch, what I said was that if you would have applyed all the bug fixes this should not have happend...
Title: Re: Searching not working with PHP5
Post by: WeZ on August 16, 2006, 12:22:28 AM
Hi V@no,

coming from a software dev company i can understand where you are coming from.

so to move ahead with my problem, i have applied all the bugfixes applicable for 1.7.2
i then cleared out the index and completely rebuilt it.

still not working...

but i have narrowed the problem down, is that the partial match is not working.

if an image has the name "Carola del bianco copy" and i search for "carola" - it returns the image. if i search for "carol" or even "carol*" it returns nothing.

any ideas or do you need to see my php's

Kind Regards,
WeZ
Title: Re: Searching not working with PHP5
Post by: V@no on August 16, 2006, 12:53:55 AM
Thats interesting...are there any non-latin letters in the name? (probably not, but want to make sure ;))
Can I test it?
if you search directly in the database in 4images_wordlist table, an you find word "carola"?
i.e. you can use this query:
Code: [Select]
SELECT *
FROM 4images_wordlist
WHERE word_text LIKE 'carola'
Title: Re: Searching not working with PHP5
Post by: WeZ on August 16, 2006, 01:13:55 AM
Hi V@no,

thanks for the prompt help as usual...

No, no latin letters - this is with any image i try search on...

your SQL query came back with:
word_text   word_id 
carola          8354

and running it with 'carol' didn't return anything as well.

does this Help?
Title: Re: Searching not working with PHP5
Post by: WeZ on August 16, 2006, 01:16:15 AM
Hi V@no,

'carol*' also didn't return anything in SQL either  :roll:

Kind Regards,
WeZ
Title: Re: Searching not working with PHP5
Post by: V@no on August 16, 2006, 02:16:59 AM
hmm...I think its a bug...well, at least even in v1.7.3 it seems you cant search for partial word...I'll try investigate it ;)
Title: Re: Searching not working with PHP5
Post by: mawenzi on August 16, 2006, 09:28:53 AM
@ WeZ

try this -> http://www.4homepages.de/forum/index.php?topic=13990.msg75500#msg75500
Title: Re: Searching not working with PHP5
Post by: WeZ on August 16, 2006, 10:50:53 AM
Hi Mawenzi,

That didn't help. Thanks for the attempt anyway - I will be interested on what V@no comes up with as it looks like a SQL thing

Kind Regards,
WeZ
Title: Re: Searching not working with PHP5
Post by: WeZ on August 16, 2006, 01:51:52 PM
Hi V@no and Mawenzi,

after a self-inflicted crash course in mysql  8O i found that the running your code
Code: [Select]
SELECT *
FROM 4images_wordlist
WHERE word_text LIKE 'carola'

returns one result but running the code
Code: [Select]
SELECT *
FROM 4images_wordlist
WHERE word_text LIKE 'carol*'

returns no result

but running the code
Code: [Select]
SELECT *
FROM 4images_wordlist
WHERE word_text LIKE 'carol%'

returns two results

further testing shows that if i use % as the partial operator, then the expected results occur.

Now that we have identified the problem How do i Proceed (seeing as 4images uses * as it's operator)?

Thanks
Title: Re: Searching not working with PHP5
Post by: V@no on August 16, 2006, 02:49:15 PM
actualy 4images already converts * into %...the problem is somewhere else...(I didnt have chance to look into it yet :oops: )

[edit]
Just realized, in v1.7.3 this is a bug, and Jan is working on it...
As of v1.7.2 and below, this particular issue never came up, so its possible something on your end...try use fresh search.php and apply the bug fixes.

Meanwhile you can try add in search.php above
Code: [Select]
      $search_word_cache[$i] = array();
This:
Code: [Select]
      echo $sql;
Then search for carol* it should show you the mysql query it used for searching, see if its correct ;)