Advanced search with Drupal (Views and CCK)
Asked Answered
G

3

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.

Gnat answered 26/5, 2009 at 7:59 Comment(0)
R
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)

Rosenarosenbaum answered 26/5, 2009 at 10:11 Comment(0)
B
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?

Buddhology answered 30/5, 2009 at 17:42 Comment(3)
I was actually able to implement the search functionality with Views but wrote my own module for creating and handling the search form.Gnat
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.Buddhology
To sum up: if you know PHP, to search-enable a View - the simplest solution is to build a form with Form API. Sealed.Rosenarosenbaum
T
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!

Ternion answered 15/10, 2013 at 18:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.