Tuomas Paasonen
Tuomas Paasonen

Reputation: 141

Advanced search with Drupal (Views and CCK)

I'm building a site where products are hold in a content type created with CCK. Products can be associated with multiple taxonomy vocabularities. Now I need an advanced product search which user could use to search by many search arguments (taxonomy terms, CCK field values). I have done quite a lot googling but I haven't been able to find a flexible enough module.

I have been able to create almost all needed features with Views' arguments but haven't been able to find a way to make the search form without my own custom search box. This isn't really the solution I'm looking for.

The question(s) follow: Is there a proper module for flexible custom searches or is an own module the only way? Is there a module for argument form for Views.

Upvotes: 14

Views: 25886

Answers (3)

Beto Aveiga
Beto Aveiga

Reputation: 3670

I think you must start using Views API and the hooks provided by views. https://api.drupal.org/api/views/views.api.php/group/views_hooks/7

Very important is views_get_view. See the docs, load your view and inspect the view with dpm (devel module). You can modify it programmatically and then execute it. https://api.drupal.org/api/views/views.module/function/views_get_view/7

Remember that you can modify the exposed form of your views using hook_form_alter.

Faceted search is a very good choice as everyone said, but views is very flexible and easier.

Hope that helps!

Upvotes: 0

bangpound
bangpound

Reputation: 166

Faceted Search and ApacheSolr integration modules are the two (separate) methods I would recommend.

Did you exhaust all of the possibilities of Views exposed filters?

Upvotes: 5

AlexA
AlexA

Reputation: 4118

There is a "Faceted Search" module (http://drupal.org/project/faceted_search) that offers an interesting concept of search, also applicable to CCK fields too. You can see a demo here. It rather offers you to select existing value sets (facets) and browse them elegantly, but still it's a search. (Use together with http://drupal.org/project/cck_facets)

Upvotes: 7

Related Questions