1

Using Drupal on a project which I made custom node types in using the CCK. I want to be able to search the specific node based on a custom field the node has. So let's say I have this node type Article which has a field "myfield", I want to be able to search for Articles based on the myfield field. I understand the default search module allows for searching of node types using the type:MyNodeType in the search, but I did not see any way to limit which fields are searched. Any tips? Is this something that is going to get crazy? Appreciate the help.

kiamlaluno
  • 24,790
  • 16
  • 70
  • 85
Joseph
  • 11,022
  • 15
  • 65
  • 109

3 Answers3

3

The default search cannot filter by specific fields.

You have a couple options.

  • Write custom code that filters again the actual fields in the database.
  • Use the Views module, which lets you filter against specific fields.
  • Install the ApacheSolr search engine, which can filter against specific fields.
    • This is a fairly complex thing to install.
    • If you're comfortable installing it, though, it's a better and more flexible search than the other two options.
ceejayoz
  • 165,698
  • 38
  • 268
  • 341
1

Checkout the CCK Facets module. Some more details about this module (from its project page):

CCK Facets is a bundle of modules that integrate with Faceted Search to expose Content Construction Kit (CCK) fields as facets. This allows users to browse field values and to filter search results with those values.

The supported CCK field types are:

  • Text
  • Number
  • Node Reference
  • User Reference
  • Date
  • Datestamp
Community
  • 1
  • 1
Nikit
  • 5,138
  • 16
  • 29
0

I use the Search API and Search API DB modules along wth Views for this.

This is a nice how to article.

Wtower
  • 15,424
  • 11
  • 94
  • 69