PDA

View Full Version : Problem for short words


infoland
02-23-2005, 06:17 AM
I've a "strange" problem.

All is indexing fine (html, php, pdf...not doc/xls :( ).

But when i make a search, if i type a single letter or a 2 letter word, i obtain a "superb" error message :

Notice: Uninitialized string offset: 0 in D:\Apache2\htdocs\diggy\libs\search_function.php on line 590

Notice: Uninitialized string offset: 0 in
D:\Apache2\htdocs\diggy\libs\search_function.php on line 597

My parameters are correct :

define('SMALL_WORDS_SIZE',2); //words to not index - must be 2 or more
define('MAX_WORDS_SIZE',30); //max word size

Why such an error ?

Does anyone has a solution ?

Thank you in advance.

PS : i'm using phpdig 1.8.7, apache2, php 4.3.10

Charter
02-23-2005, 06:19 AM
PhpDig version?

infoland
02-23-2005, 06:22 AM
I've edited my post...sorry

Charter
02-23-2005, 06:27 AM
PhpDig v.1.8.7, are you sure? I thought I fixed this:

http://www.phpdig.net/forum/showthread.php?t=1666

infoland
02-23-2005, 06:31 AM
As sure as i'm writing to you ;)

And my search_function.php contains the right code

else {
if (is_array($strings)) {
$strings = array_values($strings);
$num_in_strings_arr = count($strings);
}
else { $num_in_strings_arr = 0; }
$leven_final = "";
$leven_sum = 0;

I'm a little bit disapointed :confused:

Charter
02-23-2005, 06:54 AM
Hmm, so in search_function.php right after:

if (($num_in_strings_arr > 0) && (strlen($path) == 0)) {

Add the following:

echo $num_in_strings_arr."<br>";
print_r($strings);

And then do a search for a single letter and tell me what prints out.

infoland
02-23-2005, 07:17 AM
It tells (that's in french)

"tv", sont des mots trop courts et ont été ignorés.

That's working...what was the problem ???

Charter
02-23-2005, 07:54 AM
I turned error reporting on high but could not duplicate the problem in v.1.8.7 so I don't know.

infoland
02-23-2005, 08:10 AM
Perhaps a problem of upgrading on my server.

I'll see.

Thanks a lot for your help.

Have a nice day.