I am using categories to organized my site but running into a problem with search.

I start with a vanilla install.
Add several custom node type modules I have created.
Create loads of fake entries to organize and search.
Run search on this large set and paginate through atleast 4 pages successfully
Then I enable categories, cat legacy, cat. transform
Create categories based off one of my custom node types
Re-index and search
When navigating through the paged results...
http://confused.com/cms/?q=search/node/game&page=3
I lose my paged links.
If I manually navigate to the next page they return.

Disabling categories restores correct search functionality when stepping through the pages search results.
Enable categories again and search breaks again!
I have also tried enabling just categories with the same result.

Any ideas?

Comments

gte451f’s picture

Bump!

davemybes’s picture

Priority: Normal » Critical

I can confirm this problem. I am using Drupal 4.7.3 with category module v 1.100.2.20 2006/09/25 13:35:46. It has been driving me crazy for the last few hours trying to search for help with pager etc. Finally I figured out it this category module causing all the problems. My client is using category almost exclusively to create their site. So naturally, when they search, they see the first 10 results and no pager. This is a SERIOUS problem! I'd hate to tell them to remove category module and redo all their nodes (several thousand of them).

My own test showed that I could have lots of regular pages in the results, but as soon as a result is a category, the pager disappears from the page.

rednaxus’s picture

agreed on this one. I disabled category nodes from indexing (we don't need to index category nodes):
function node_update_index()
...
if ($node->type == 'category-cont' || $node->type == 'category-cat') continue;
...

davemybes’s picture

OK, so where does this code need to placed exactly? In node.module's function within the while loop?

I'm guessing that this will be fine for those people with only a few categories, but the site I was working on is made completely out of containers and categories - there are only a handful of regular pages. So not indexing them is not really an option in this case, I'm afraid.

Dabitch’s picture

Search your node.module for the following:

function node_update_index() {
global $last_change, $last_nid;

and place the snippet rednaxus showed right below that. Worked for me. Thanks.

JirkaRybka’s picture

Version: master » 4.7.x-1.x-dev
Priority: Critical » Normal

Based on timestamps of the comments above, the HEAD was actually 4.7.x here.

I quite never noticed myself, but now I see that my 5.x production site displays a similar weird behavior: When I search for a word, which is in nearly *all* posts on the site, I get some results, and pager indicating only just 2 pages of results. After I go to the second page, the pager suddenly shows 10+ pages.

I'm going to check, how my 6.x test-site behave on search, and then decide if I need to look into this.

JirkaRybka’s picture

Marking #115272: Category breaks Search Module?! as duplicate.

Apart from that, I checked on my 6.x site now, and the problem definitely does NOT happen there. So I'm tempted to just close this issue as obsolete (postponing that for now, to further check as time permits, and to possibly hear from others here?)