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.
问问题
2216 次
3 回答
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.
于 2010-05-08T21:20:02.977 回答
1
查看CCK Facets模块。有关此模块的更多详细信息(来自其项目页面):
CCK Facets 是一组与Faceted Search集成的模块,可将Content Construction Kit (CCK)字段作为 facets 公开。这允许用户浏览字段值并使用这些值过滤搜索结果。
支持的 CCK 字段类型有:
- 文本
- 数字
- 节点参考
- 用户参考
- 日期
- 日期戳
于 2010-05-08T21:55:17.690 回答
0
为此,我将 Search API 和 Search API DB 模块与 Views 一起使用。
这是一篇不错的文章。
于 2013-07-22T06:56:03.627 回答