Fastsearch is generating queries from searches that are running forever (until my server crashes from all the other locked up queries). It happens when somebody enters a search with many common words. For example "how can I find the best mp3 software in the world please help me".

Looking at the query log shows the query being generated has a table joined for every term so it is easy to see why the query cause problems. Here is an example

SELECT count(DISTINCT(node.nid))
        FROM node node
                LEFT JOIN search_index search_index
                        ON node.nid = search_index.sid
                LEFT JOIN search_index search_index2
                        ON node.nid = search_index2.sid
                LEFT JOIN search_index search_index3
                        ON node.nid = search_index3.sid
                LEFT JOIN search_index search_index4
                        ON node.nid = search_index4.sid
                LEFT JOIN search_index search_index5
                        ON node.nid = search_index5.sid
                LEFT JOIN search_index search_index6
                        ON node.nid = search_index6.sid
                LEFT JOIN search_index search_index7
                        ON node.nid = search_index7.sid
                LEFT JOIN search_index search_index8
                        ON node.nid = search_index8.sid
                LEFT JOIN search_index search_index9
                        ON node.nid = search_index9.sid
                LEFT JOIN term_node term_node
                        ON node.nid = term_node.nid
                LEFT JOIN term_hierarchy term_hierarchy
                        ON term_node.tid = term_hierarchy.tid
                LEFT JOIN content_field_short_desc_0 node_data_field_short_desc_0
                        ON node.vid = node_data_field_short_desc_0.vid
                LEFT JOIN content_type_listing6 node_data_field_file_date
                        ON node.vid = node_data_field_file_date.vid
                LEFT JOIN node_comment_statistics node_comment_statistics
                        ON node.nid = node_comment_statistics.nid
                LEFT JOIN content_field_view_count node_data_field_view_count
                        ON node.vid = node_data_field_view_count.vid
        WHERE
                (node.status = '1') AND (node.type IN ('listing6')) AND
                ((search_index.word='best' AND search_index2.word='mp3' AND search_index3.word='the' AND search_index4.word='ion' AND search_index5.word='the' AND search_index6.word='wolrld' AND search_index7.word='how' AND search_index8.word='can' AND search_index9.word='for')) AND (term_node.tid = '59')

I'm surprised not to find many other support issues like this. Is there something I'm missing or is this a problem with fastsearch?

Comments

douggreen’s picture

You didn't read the release notes and install the required patch. Go back to the project home page and do that. You are reporting a problem that existed several years ago but is solved if youinstall correctly. Sorry for being terse. Sent from my iPhone.

dejbar’s picture

Thanks for your help. I guess I must have naively thought that anything as important as this would have been mentioned in the README file and and the required patch files would have been incorporated into the release.

douggreen’s picture

Status: Active » Closed (fixed)

Housekeeping