4images Forum & Community

4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: fitterashes on September 29, 2010, 08:37:28 PM

Title: multi-word search in 1.7.8
Post by: fitterashes on September 29, 2010, 08:37:28 PM
Hello,

I don't know if this issue is related to the last update or my configuration, but i just noticed a problem with the search engine and the keywords :

- Search with a single word works fine (ie : houston)
- Search with 2 words (space separated) = Your search resulted in no matching records. (ie : houston washington)
- Search with 2 words using AND, OR, NOT = Your search resulted in no matching records. (ie:  houston AND washington)

- Search with 2 words seperated by a comma = works fine, same as using "OR" (ie:  houston,washington)
- Search with 2 words using comma + AND = works fine (ie : houston,AND,washington)

So there's a bug with space and commas i guess, any help to fix that please ?
nb : I use the last version 1.7.8, I did the keyword migration, and i have unmodified search.php and search_utils.php

Thank you
Title: Re: multi-word search in 1.7.8
Post by: V@no on September 30, 2010, 02:41:21 AM
Yes, it's a bug.

Please test this. In includes/search_utils.php find:

  $split_words = preg_split("/,+/", $val);

Replace it with:
  if ($for_search)
  {
    $split_words = preg_split("/\s+/", $val);
  }
  else
  {
    $split_words = preg_split("/,+/", $val);
  }
Title: Re: multi-word search in 1.7.8
Post by: fitterashes on September 30, 2010, 03:59:56 PM
seems to be ok now, Thank you  :wink: