Hi.

I've noticed that Drupal does not include node titles when doing a search. Is this correct and how do I make Drupal search my node titles as well?

Any help much appreciated.

- Luke

Comments

pan69’s picture

I just noticed that its actually different. I've just noticed that only the titles of some nodes are not included in search. What could be the reason for this behavior?

pan69’s picture

Even in "advanced search" it can't find anything.

One of my nodes has the title PVL-80. I've re-indexed the site on the search settings page and run cron. When searching for "pvl-80" no results show up. Searching for "PVL-80" no results show up. Whats going on?

Thanks,
Luke

pan69’s picture

Ok. I've been able to find out the following. The reason my PLV-80 node didn't show up had something to do with fact the "minimum word length to index" on the search settings page was set to 3 (default). Changing this to 2 made the node show up in search. However, searching for 80 doesn't bring up this particular node?

pan69’s picture

This is still a big issue. E.g I have another nodes with the title VCP-CG9-EX and VCP-CG9-BKEX.

Searching for VCP-CG9-EX = no results
Searching for VCP-CG9-BKEX = no results
Searching for VCP-CG9 = no results

What's going on? Shouldn't Drupal pick this stuff up?

pan69’s picture

I found a solution but it involves quite a bit of work. My site is product based and there are about 250 products to search for plus all kinds of other data like instruction manuals etc.

My solution at this point is to give every product node a keywords field. I've added this through CCK. For every product I need to fill this out to make my product show up in search results. E.g. for the product I mentioned in a previous post I need to fill out the following:

VCPCG9EX VCP-CG9-EX VCP CG9 EX

This will make the product show up in most common search results.

I still have the impression that Drupal does not a good job at indexing all the nodes. I think Drupal does not index all the nodes but only a certain amount of them. I think this is the reason that not all nodes show up in search while others do...

pan69’s picture

PS. Thanks to everyone on sharing their thoughts on this issue... not...

Anonymous’s picture

I'm also having the same problem I have a certain content type that contains company information and the title field is the company name so I would like it to search all of the companies using the default drupal search but it only seems to be searching the contents of the nodes not the titles. Anyone have any idea what might be going on?

Thanks,

tristan.oneil

pan69’s picture

I'm still not fully understanding this. My site works good enough but the whole search functionality is quite vague. I can't find decent documentation on how the actual search works and how to theme all the search related content. Even though I've got it all working, I do not fully understand the system so I can't really help you out...

Anonymous’s picture

I figured it out for myself. I'm not sure if it applies for you as well but I found that since I had imported my data using direct import through MySQL that it wasn't indexing the imported data for some reason. So I used a module called Retease to rebuild the teasers for all of my content then re-index my site and it is finding everything just fine now. If this applies to you, you can find the Retease module here: http://drupal.org/project/retease

tristan.oneil

pan69’s picture

Hi. Thanks for posting this! However, I had difficulties searching for text that appears in node titles. All my content is entered manually through the Drupal admin interface so you would think it should be picked up properly. Still not sure how it works. I will check out that module.

Thanks

Anonymous’s picture

Yea, I would think it should be indexing everything if it was manually entered, but why not give this module a try and let me know how it goes.

tristan.oneil

keesje’s picture

I had the same problem on a 1000+ node site. Almost all nodes are Ubercart product nodes.

A lot of nodes where just missing in the search results after some upgrades, adding some modules and migrating the site to another server with other software (php version APC caching, etc.). So, I really have no clue what caused this, the problem could even be there before the migration without being noticed.

Rebuilding the search index was'nt solving.
Emptying search tables and then rebuilding the search index was solving a lot, but not all missing search results.

When re-saving a missing node it reoccurs in the search results

Rebuilding all teasers with retease was fully resolving this issue. I bet it's not due to the rebuilt teasers, but the fact that the node is changed/resaved by the module.

Anyway, thanks for sharing, saved my day ;).

baff’s picture

Same happend to me when restoring a database. Reindexing did not help. Emptying search tables + Reindexing solved it.