I recently upgraded my site to use thinking_sphinx 3.0.6 and Sphinx 2.1.2.
Before I turned traffic on to the new site, search seemed to work fine. Now
that I've turned traffic on, I get inconsistent results when doing the same
search repeatedly.
I added some logging to my code to eliminate other potential causes (like
Rails fragment caching). I'm searching for a fairly uncommon term so I can
be sure that I'm identifying only my own requests and that all the
parameters will be the same.
@styles = Style.search keywords, :match_mode => :extended, :page =>
params[:page], :order => new_sort.gsub('DIR', sort_direction.upcase),
:per_page => options[:per_page], :conditions => new_search_conditions,
:populate => true, :select => 'weight() myweight'
logger.info "Search for #{params[:search_terms]} returned #{@styles.length}
results."
The results in the log are:
2013-11-21 03:53:51.621 6091 [INFO ] Search for avclub returned 10 results.
2013-11-21 03:53:52.922 6067 [INFO ] Search for avclub returned 2 results.
2013-11-21 03:53:54.134 6067 [INFO ] Search for avclub returned 10 results.
2013-11-21 03:53:55.888 6083 [INFO ] Search for avclub returned 0 results.
2013-11-21 03:53:57.140 6059 [INFO ] Search for avclub returned 10 results.
(The 2 results request was correct.)
Looking at the searchd log, I see:
[Thu Nov 21 03:53:51.620 2013] 0.000 sec 0.000 sec [ext2/1/ext 2 (0,10)]
[style_core`, `style_delta] avclub
[Thu Nov 21 03:53:52.921 2013] 0.000 sec 0.000 sec [ext2/1/ext 2 (0,10)]
[style_core`, `style_delta] avclub
[Thu Nov 21 03:53:54.133 2013] 0.000 sec 0.000 sec [ext2/1/ext 2 (0,10)]
[style_core`, `style_delta] avclub
[Thu Nov 21 03:53:55.889 2013] 0.000 sec 0.000 sec [ext2/1/ext 2 (0,10)]
[style_core`, `style_delta] avclub
[Thu Nov 21 03:53:57.139 2013] 0.000 sec 0.000 sec [ext2/1/ext 2 (0,10)]
[style_core`, `style_delta] avclub
Showing searchd gave me 2 results each time.
When I don't get the correct results, I see what seems to be the results of
a search with different parameters. If I check the log, I can correlate
what I saw with another search that happened within a second before mine.
--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/groups/opt_out.