14

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.

Tuomas Paasonen
  • 141
  • 1
  • 1
  • 5

3 Answers3

7

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)

AlexA
  • 4,028
  • 8
  • 51
  • 84
5

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?

bangpound
  • 166
  • 3
  • I was actually able to implement the search functionality with Views but wrote my own module for creating and handling the search form. – Tuomas Paasonen Jun 01 '09 at 13:31
  • I've done the same thing. If there's a quicker solution that allows for great customization, I've not seen one better than Drupal Form API and a good understanding of executing Views. – bangpound Jun 04 '09 at 07:52
  • 2
    To sum up: if you know PHP, to search-enable a View - the simplest solution is to build a form with Form API. Sealed. – AlexA Aug 13 '09 at 15:22
0

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!

Beto Aveiga
  • 3,466
  • 4
  • 27
  • 39