1

I'm wondering why I only get one result in my search.

My search query is this:
http://www.norwegianfashion.no/?s=oslo+fashion+week

If I search google, you'll see I got plenty of hits:
http://www.google.no/search?hl=en&client=opera&hs=GTw&rls=en-GB&q=oslo+fashion+week+site%3Awww.norwegianfashion.no&aq=f&aqi=&aql=&oq=&gs_rfai=

On my local computer I looked in the query log and I see this:

       29 Query SELECT option_name, option_value FROM nfwp_options WHERE autoload = 'yes'
       29 Query SELECT option_value FROM nfwp_options WHERE option_name = 'akismet_comment_nonce' LIMIT 1
       29 Query SELECT * FROM nfwp_users WHERE user_login = 'admin'
       29 Query SELECT user_id, meta_key, meta_value FROM nfwp_usermeta WHERE user_id IN (1)
       29 Query SELECT SQL_CALC_FOUND_ROWS  nfwp_posts.* FROM nfwp_posts  WHERE 1=1  AND (((nfwp_posts.post_title LIKE '%oslo%') OR (nfwp_posts.post_content LIKE '%oslo%')) AND ((nfwp_posts.post_title LIKE '%fashion%') OR (nfwp_posts.post_content LIKE '%fashion%')) AND ((nfwp_posts.post_title LIKE '%week%') OR (nfwp_posts.post_content LIKE '%week%')) OR (nfwp_posts.post_title LIKE '%oslo fashion week%') OR (nfwp_posts.post_content LIKE '%oslo fashion week%'))  AND nfwp_posts.post_type IN ('post', 'page', 'attachment') AND (nfwp_posts.post_status = 'publish' OR nfwp_posts.post_author = 1 AND nfwp_posts.post_status = 'private')  ORDER BY nfwp_posts.post_date DESC LIMIT 0, 10
       29 Query SELECT FOUND_ROWS()
       29 Query SELECT post_id, meta_key, meta_value FROM nfwp_postmeta WHERE post_id IN (4139,4135,4130,4129,3831,4126,3750,2564,3667,3573)
       29 Query SELECT t.*, tt.* FROM nfwp_terms AS t INNER JOIN nfwp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN nfwp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('post_tag') AND tr.object_id IN (4139) ORDER BY t.name ASC
       29 Query SELECT t.*, tt.* FROM nfwp_terms AS t INNER JOIN nfwp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = 'nav_menu' AND t.term_id = '0' LIMIT 1
       29 Query SELECT t.*, tt.* FROM nfwp_terms AS t INNER JOIN nfwp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = 'nav_menu' AND t.slug = 'quick-menu' LIMIT 1
       29 Query SELECT tr.object_id FROM nfwp_term_relationships AS tr INNER JOIN nfwp_term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('nav_menu') AND tt.term_id IN ('997') ORDER BY tr.object_id ASC
       29 Query SELECT   nfwp_posts.* FROM nfwp_posts  WHERE 1=1  AND nfwp_posts.ID IN (4309) AND nfwp_posts.post_type = 'nav_menu_item' AND (nfwp_posts.post_status = 'publish')  ORDER BY menu_order ASC
       29 Query SELECT post_id, meta_key, meta_value FROM nfwp_postmeta WHERE post_id IN (4309)
       29 Query SELECT   nfwp_posts.* FROM nfwp_posts  WHERE 1=1  AND nfwp_posts.ID IN (2) AND nfwp_posts.post_type = 'page' AND (nfwp_posts.post_status = 'publish')  ORDER BY nfwp_posts.post_date DESC
       29 Query SELECT post_id, meta_key, meta_value FROM nfwp_postmeta WHERE post_id IN (2)
       29 Query SELECT SQL_CALC_FOUND_ROWS  nfwp_posts.* FROM nfwp_posts  WHERE 1=1  AND (((nfwp_posts.post_title LIKE '%oslo%20fashion%20week%') OR (nfwp_posts.post_content LIKE '%oslo%20fashion%20week%')))  AND nfwp_posts.post_type IN ('post', 'page', 'attachment') AND (nfwp_posts.post_status = 'publish' OR nfwp_posts.post_author = 1 AND nfwp_posts.post_status = 'private')  ORDER BY nfwp_posts.post_date DESC LIMIT 0, 10
       29 Query SELECT FOUND_ROWS()
       29 Query SELECT t.*, tt.* FROM nfwp_terms AS t INNER JOIN nfwp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = 'nav_menu' AND t.term_id = '0' LIMIT 1
       29 Query SELECT t.*, tt.* FROM nfwp_terms AS t INNER JOIN nfwp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = 'nav_menu' AND t.slug = 'main-menu' LIMIT 1
       29 Query SELECT tr.object_id FROM nfwp_term_relationships AS tr INNER JOIN nfwp_term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('nav_menu') AND tt.term_id IN ('939') ORDER BY tr.object_id ASC
       29 Query SELECT   nfwp_posts.* FROM nfwp_posts  WHERE 1=1  AND nfwp_posts.ID IN (3729,3731,3732,3733,3734,3735) AND nfwp_posts.post_type = 'nav_menu_item' AND (nfwp_posts.post_status = 'publish')  ORDER BY menu_order ASC
       29 Query SELECT post_id, meta_key, meta_value FROM nfwp_postmeta WHERE post_id IN (3729,3734,3733,3732,3731,3735)
       29 Query SELECT   nfwp_posts.* FROM nfwp_posts  WHERE 1=1  AND nfwp_posts.ID IN (30,31,786,3365,7) AND nfwp_posts.post_type = 'page' AND (nfwp_posts.post_status = 'publish')  ORDER BY nfwp_posts.post_date DESC
       29 Query SELECT post_id, meta_key, meta_value FROM nfwp_postmeta WHERE post_id IN (3365,786,31,30,7)
       29 Query SELECT t.*, tt.* FROM nfwp_terms AS t INNER JOIN nfwp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN nfwp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category') AND tr.object_id IN (4139) ORDER BY t.name ASC
       29 Query SELECT SQL_CALC_FOUND_ROWS  nfwp_posts.* FROM nfwp_posts  WHERE 1=1  AND nfwp_posts.post_type = 'post' AND (nfwp_posts.post_status = 'publish')  ORDER BY nfwp_posts.post_date DESC LIMIT 0, 5
       29 Query SELECT FOUND_ROWS()
       29 Query SELECT t.*, tt.*, tr.object_id FROM nfwp_terms AS t INNER JOIN nfwp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN nfwp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category', 'post_tag') AND tr.object_id IN (4329, 4318, 4313, 4303, 4277) ORDER BY t.name ASC
       29 Query SELECT post_id, meta_key, meta_value FROM nfwp_postmeta WHERE post_id IN (4329,4318,4313,4303,4277)
       29 Query SELECT t.*, tt.* FROM nfwp_terms AS t INNER JOIN nfwp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = 'category' AND t.term_id = '998' LIMIT 1
       29 Query SELECT * FROM nfwp_users WHERE ID = 31 LIMIT 1
       29 Query SELECT user_id, meta_key, meta_value FROM nfwp_usermeta WHERE user_id IN (31)
       29 Query SELECT * FROM nfwp_comments WHERE  comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 5
       29 Query SELECT * FROM nfwp_posts WHERE ID = 1154 LIMIT 1
       29 Query SELECT t.*, tt.* FROM nfwp_terms AS t INNER JOIN nfwp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN nfwp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category') AND tr.object_id IN (1154) ORDER BY t.name ASC
       29 Query SELECT * FROM nfwp_posts WHERE ID = 1684 LIMIT 1
       29 Query SELECT t.*, tt.* FROM nfwp_terms AS t INNER JOIN nfwp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN nfwp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category') AND tr.object_id IN (1684) ORDER BY t.name ASC
       29 Query SELECT * FROM nfwp_posts WHERE ID = 3432 LIMIT 1
       29 Query SELECT t.*, tt.* FROM nfwp_terms AS t INNER JOIN nfwp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN nfwp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category') AND tr.object_id IN (3432) ORDER BY t.name ASC
       29 Query SELECT * FROM nfwp_posts WHERE ID = 4138 LIMIT 1
       29 Query SELECT t.*, tt.* FROM nfwp_terms AS t INNER JOIN nfwp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN nfwp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category') AND tr.object_id IN (4138) ORDER BY t.name ASC

You can see that it finds several articles (3729,3731,3732,3733,3734,3735).
I also see a lot of LIMIT 1 in these queries. IS that correct?

Any ideas why I'm only getting one result?

1 Answer 1

4

What template does search page use? It is either generic index.php or specialized search.php. What does Loop in that template look like?

I suspect this might be Loop issue that is set to only dislpay single post, instead of iterating all of them.

1
  • You are right. I use search.php taken from the default theme. A closer look I see that it is using ` get_template_part( 'loop', 'search' );`. I'm not used to this new feature in WP, so I over looked it. Thanks :)
    – Steven
    Dec 15, 2010 at 18:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.