Search without keywords

Events happening in the community are now at Drupal community events on www.drupal.org.
misc's picture

I want the search function on the site I am building to search just for a conten type or just in a taxonomy - but the function complains that I do not have any keywords - which is true - but is there a way to use the advanced search and not have to write in any keywords?

Comments

That's not a search

Balbo's picture

If I did understand what you mean, you just want all results of a particular type in a taxonomy without a "word" to be searched. Right? If so, this isn't a Search but a View.

No, I want the user to use

misc's picture

No, I want the user to use the search function - they could write a keyword or the could not, they can choose one or many content types to search within and so on.

/* Mikke Schirén, https://digitalist/ */

Use the faceted search:

Drupal Addict,
Gabriel Ungureanu
www.ag-prime.com

But yes, this is search

ern0's picture

There're lot of search types beyond textual search. I have same problem, and tried some ways, but all failed.

Faceted Search is almost good, but there are some problems:
- can't customize the form, the filters always appear as links,
- can't turn off Content Type filter,
- can't change title for Taxonomies (e.g. "enter your country" instead of "countries", or "book author" instead of "poets").

Now I'm using Views with user-selectable filters, but it's ugly and also can't customize the form (e.g. radio buttons instead of list).

You probably can alter the views form...

jhodgdon's picture

You should actually be able to use hook_form_alter() to alter the views form to use radios instead of list boxes, or write a views add-on that would define a filter that puts a radio select on the screen. And you can style it however you want to make it less "ugly".

Regarding search without keywords in general: the core Search module is fundamentally a keyword search. It was never designed to be a faceted search, which is really what you are looking for, even if you don't like the UI of the Drupal Faceted Search module. You could probably also write your own faceted search UI module though, since the UI for searching is a separate module from the core part that actually does the searching.

The saying is true again: "there's a module for it"

ern0's picture

First I tried Better Filter module, but I ran into some bugs with it, even with the latest version. If I did not selected anything in a multiselect checkbox group, it caused empty result, unless I didn't checked any (or all).

Also, after some hundreds of clicks I've got "invalid selection" message with big SQL query dump.

But don't worry, there's a better module for this issue, which works well, and it also provides optional "select all/none" widget (dhtml link), event it's unnecessary, "none" now means "all", like usual:
https://drupal.org/project/better_exposed_filters

Happy form building to everyone!

Search

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: