4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
June 23, 2018, 09:15:25 PM

Login with username, password and session length
Search:     Advanced search
Follow 4images on twitter: Click here to follow!
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Issues / Ausgaben
| |-+  Discussion & Troubleshooting (Moderators: Acidgod, ivan, Rembrandt)
| | |-+  multi-word search in 1.7.8
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: multi-word search in 1.7.8  (Read 6606 times)
fitterashes
Newbie
*
Offline Offline

Posts: 30

Thank You
-Given: 0
-Receive: 1


View Profile
« 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
Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 576

mmm PHP...


View Profile WWW
« Reply #1 on: September 30, 2010, 02:41:21 AM »

Yes, it's a bug.

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

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

Replace it with:
1
2
3
4
5
6
7
8
  if ($for_search)
  {
    
$split_words preg_split("/\s+/"$val);
  }
  else
  {
    
$split_words preg_split("/,+/"$val);
  }

Follow members gave a thank to your post:
InAction

For this post, 1 member gave a thank you!
Logged

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
fitterashes
Newbie
*
Offline Offline

Posts: 30

Thank You
-Given: 0
-Receive: 1


View Profile
« Reply #2 on: September 30, 2010, 03:59:56 PM »

seems to be ok now, Thank you  Wink
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.376 seconds with 22 queries.
Post your comments here