Author Topic: Make Search Ignore Specific Common Words  (Read 11493 times)

0 Members and 1 Guest are viewing this topic.

Offline nuzecast

  • Pre-Newbie
  • Posts: 9
    • View Profile
Make Search Ignore Specific Common Words
« on: March 22, 2009, 12:36:06 AM »
Using 1.7.6

Looking for a way to make search ignore words like "the" and similarly common words.

Thanks in advance.

Nuzecast

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Make Search Ignore Specific Common Words
« Reply #1 on: March 22, 2009, 02:16:41 AM »
Hello and welcome to 4images forum.

Common words are listed in lang/<your language>/stop_searchterms.txt file. These words should be ignored by 4images search engine.
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)

Offline nuzecast

  • Pre-Newbie
  • Posts: 9
    • View Profile
Re: Make Search Ignore Specific Common Words
« Reply #2 on: March 22, 2009, 03:10:45 AM »
Thanks for the reply.

Found the stop_searchterms.txt and tried searching for a few of them and they do return results.

examples:  fifty, and, the

Does this have to be enabled somewhere?

Thanks
Nuzecast

Offline nuzecast

  • Pre-Newbie
  • Posts: 9
    • View Profile
Re: Make Search Ignore Specific Common Words
« Reply #3 on: March 22, 2009, 03:22:45 AM »
Found the issue.

In includes/search_utils.php there is an error.

It looks for search_stopterms.txt but the file is stop_searchterms.txt

Thanks
Nuzecast

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Make Search Ignore Specific Common Words
« Reply #4 on: March 22, 2009, 04:33:33 AM »
Oh, thank you for reporting this.

I've added into bug fixes list:
[1.7 - 1.7.6] Search stop terms not being used with english language
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)

Offline nuzecast

  • Pre-Newbie
  • Posts: 9
    • View Profile
Re: Make Search Ignore Specific Common Words
« Reply #5 on: March 22, 2009, 04:38:45 PM »
Hi there, one more search question.

I have an image titled AC/DC but search cannot find it.
I assume you are stripping out the slashes somehow.
Is there a way to allow / to be included in search?

Thanks again for your help.

Nuzecast

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Make Search Ignore Specific Common Words
« Reply #6 on: March 22, 2009, 09:15:54 PM »
Try replace in includes/search_utils.php
Code: [Select]
    "#[\n\t\r^\$\(\)<>\"\|,@\?%~\+\.\[\]{}:\/=!§\\\\]+#s"
with this:
Code: [Select]
    "#[\n\t\r^\$\(\)<>\"\|,@\?%~\+\.\[\]{}:=!§]+#s"
« Last Edit: March 22, 2009, 11:44:59 PM by V@no »
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)

Offline nuzecast

  • Pre-Newbie
  • Posts: 9
    • View Profile
Re: Make Search Ignore Specific Common Words
« Reply #7 on: March 22, 2009, 11:04:45 PM »
Thanks for the reply but still returns no results.

Nuzecast

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Make Search Ignore Specific Common Words
« Reply #8 on: March 22, 2009, 11:46:37 PM »
Oh I didn't realize you had forward slash...
I've updated my post above.

Also keep in mind, this change will not affect already existing keywords.
You might want use [Plugin] Rebuild Search Index for existing keywords.
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)

Offline nuzecast

  • Pre-Newbie
  • Posts: 9
    • View Profile
Re: Make Search Ignore Specific Common Words
« Reply #9 on: March 23, 2009, 01:57:15 PM »
That worked.  Thanks very much!