mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2009-08-31 09:03 am

[dw-free] Fix search. I renamed the index from test1 to dw1. This also fixes a bug where no excerpts

[commit: http://hg.dwscoalition.org/dw-free/rev/cbef12206273]

Fix search. I renamed the index from test1 to dw1. This also fixes a bug
where no excerpts are returned causing the worker to crash. That's silly; if
we have search results we should show what we have instead of crash.

Patch by [staff profile] mark.

Files modified:
  • bin/worker/sphinx-search-gm
--------------------------------------------------------------------------------
diff -r e305fa52fc08 -r cbef12206273 bin/worker/sphinx-search-gm
--- a/bin/worker/sphinx-search-gm	Sun Aug 30 15:16:04 2009 -0500
+++ b/bin/worker/sphinx-search-gm	Mon Aug 31 09:03:41 2009 +0000
@@ -89,7 +89,7 @@ sub sphinx_search {
         # FIXME: this should use some other index name than 'test1' heh, and we should probably
         # try to figure out the language of the journal being searched (or the searcher?) and use
         # an appropriate stemming library?  (future expansion opportunity)
-        my $exc = $sx->BuildExcerpts( [ map { $_->{entry} } @out ], 'test1stemmed', $args->{query}, {} );
+        my $exc = $sx->BuildExcerpts( [ map { $_->{entry} } @out ], 'dw1stemmed', $args->{query}, {} ) || [];
 
         # if we have a matching number of excerpts to events, then we can determine
         # which one goes with which post.
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org