Closed Bug 470378 Opened 17 years ago Closed 17 years ago

New search stopwords can't be changed on production

Categories

(support.mozilla.org :: Knowledge Base Software, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: nkoth, Assigned: ecooper)

Details

(Whiteboard: sumo_only)

Attachments

(1 file, 3 obsolete files)

On http://support.mozilla.com/tiki-admin_newsearch.php?admin=stopwords, it is not possible to add/remove stopwords (or to see existing stopwords for that matter). The current stopwords are: a firefox he she the we The reason for this problem is because /usr/local/sphinx/index/stopwords.txt is only on the subset of sphinxd webheads. The prefered solution to this in my opinion is to refactor to put stopwords in the database instead, or alternatively in some shared space. (usr/local/sphinx/index is not on shared space right now in case of performance issues with Netapp - hypothetical, not known for sure if there are any)
Assignee: nobody → nelson
I would probably recommend putting them in the database.
Assignee: nelson → smirkingsisyphus
Attachment #355694 - Flags: review?(nelson)
I followed the basic schema for the other se tables for this table.
Attachment #355696 - Flags: review?(nelson)
Attachment #355696 - Flags: review?(laura)
Attachment #355694 - Attachment is obsolete: true
Attachment #355694 - Flags: review?(nelson)
Attachment #355696 - Attachment is obsolete: true
Attachment #355696 - Flags: review?(nelson)
Attachment #355696 - Flags: review?(laura)
Attached patch Save stopwords to scripts/sphinx (obsolete) — Splinter Review
IT will need to update the sphinx.conf so it points to the correct location for the stopwords (scripts/sphinx/stopwords.txt).
Attachment #355704 - Flags: review?(nelson)
Comment on attachment 355704 [details] [diff] [review] Save stopwords to scripts/sphinx >Index: tiki-admin_newsearch.php >=================================================================== >--- tiki-admin_newsearch.php (revision 21446) >+++ tiki-admin_newsearch.php (working copy) >@@ -302,7 +302,7 @@ > } > elseif(isset($_GET['admin']) && $_GET['admin']=='stopwords') > { >- $stopwords = file_get_contents('/usr/local/sphinx/index/stopwords.txt'); >+ $stopwords = file_get_contents('../scripts/sphinx/stopwords.txt'); > $stopwords = explode(' ',$stopwords); > > if(isset($_GET['remove'])) >@@ -311,7 +311,7 @@ > $removed = $stopwords[$remove]; > unset($stopwords[$remove]); > sort($stopwords,SORT_STRING); >- file_put_contents('/usr/local/sphinx/index/stopwords.txt',trim(implode(" ",$stopwords))); >+ file_put_contents('../scripts/sphinx/stopwords.txt',trim(implode(" ",$stopwords))); > header('Location: tiki-admin_newsearch.php?admin=stopwords&removed='.urlencode($removed)); > } > if(!empty($_POST['stopword'])) >@@ -321,7 +321,7 @@ > { > $stopwords[] = $stopword; > sort($stopwords,SORT_STRING); >- file_put_contents('/usr/local/sphinx/index/stopwords.txt',trim(implode(" ",$stopwords))); >+ file_put_contents('../scripts/sphinx/stopwords.txt',trim(implode(" ",$stopwords))); > header('Location: tiki-admin_newsearch.php?admin=stopwords&added='.urlencode($stopword)); > } > }
Patch uses the correct relative path of ../scripts/sphinx/stopwords.txt now. I also learned what the Edit Attachment as Comment button does.
Attachment #355704 - Attachment is obsolete: true
Attachment #355709 - Flags: review?(nelson)
Attachment #355704 - Flags: review?(nelson)
Comment on attachment 355709 [details] [diff] [review] Using the proper path now in r21447/r21448. Note also that I added scripts/sphinx/stopwords.txt.dist which should be deployed to scripts/sphinx/stopwords.txt and set read/writable by apache
Attachment #355709 - Flags: review?(nelson) → review+
Marking this as resolved, but this won't be able to be verified to after push since it's a production-only bug.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Part of newsearch.
Whiteboard: sumo_only
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: