How to make complex taxonomy searches

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

Help or a nudge to the right direction from the gurus please.

How do I make complex taxonomy searches? Simplifying my drupal database to the following example (number in quotes are the taxonomy numbers assigned by drupal):

Nodes = Blogs, Stories, Questions, Forums

The following are taxonomy dropboxes

Author = A.Tan(1), B.Chua(2), C.Smith(3), D.Perez(4)
Category = Gadgets(5), Food(6), Movies(7), Entertainment(8)

I want to make a complex search for example all Blogs by B.Chua pertaining only to Movies category? I could almost do this with the advance search since it allows checkboxes to search particular nodes and taxonomy however would not accept a blank or asterix as a search word.

Thanks in advance for looking at my problem. Any help is appreciated.

Comments

I suggest you ALSO ask this

borrico1965's picture

I suggest you ALSO ask this question at Drupal Answers at Stack Exchange, if you have'nt done it yet. Perhaps you will get a reply faster there: FYI, developer-volunteers, there, get incentives to answer questions.

Thank you for the tip! I

dreadstar's picture

Thank you for the tip! I just posted the same question on Stack Exchange.

you can do this via faceted

cmcintosh's picture

you can do this via faceted views in drupal 6, and drupal 7 has the Search API which is real handy for this sort of thing. You just need to plan out how you want to go about what fields are allowed. I have done this sort of thing for use with Real Estate sites where various fields are actually taxonomy terms(makes great SEO pages). So then I define for faceted views the various taxonomy vocabs that I allow to be searchable.

If you need even more flexibility, then go with a custom module. Use form API to build you a block with the fields you want selectable(you can feed them via a db query on the terms for each vocab), then you would want to setup filters(not Arguments) on your view. Make sure that they are exposed. With them exposed play around and watch the address bar, you will quickly be able to see what change does what. Update your form api's submit handler so that it redirects (drupal_redirect i believe) to the correctly formatted url for that perticular selection of filters. once this is done then it will work real well.

Not sure your experience level but those are some of the options for you.

I could be wrong but views

dreadstar's picture

I could be wrong but views does not do exactly what I want. The taxonomy combinations will have to be hardcoded (what I dont like) to show a listing (what I like). A checkbox box of taxonomy terms to be included in the search would be great but I dont think views allows it (or I dont know how to do it).

My background - no programming skills. I can install modules and follow instructions though 8-)

Faceted Search / Search API

cmcintosh's picture

Faceted Search / Search API will probably be the best bets.

You can accomplish this by

gideon_ph's picture

You can accomplish this by creating a view in a form of a block that lists all the taxonomy terms. You can install taxonomy_node_count module so you can display the number of child nodes for each term. You will have to do a "rewrite output" to display the term name as a link together with the count.

Once you have that created, you can theme the taxonomy term node page (page-taxonomy-term.tpl.php) to display the way you want. Have the block be visible only on the taxonomy term page via block configuration.

You can check out my implementation on this site http://www.ereadingsource.com/categories/adventure. I used path auto module and URL aliasing but that is actually the taxonomy term page http://www.ereadingsource.com/taxonomy/term/1.

Hope this points you to the right direction.

I can understand your example

dreadstar's picture

I can understand your example http://www.ereadingsource.com/taxonomy/term/1

What I need; for example, is a search for something in taxonomy (1 and 3 and 5). This is different for a search for taxonomy (1 or 3 or 5) which is a combination of just search taxonomy 1 then search taxonomy 3 then search taxonomy 5. What I need is the subset intersection of taxonomy 1, 3 and 5.

I wouldn't mind a temporary solution of manually typing in the proper URL taxonomy search but I do not know the "language" to do the proper complex taxonomy combinations.

In the arguments there is a

cmcintosh's picture

In the arguments there is a setting for taxonomy tid/terms(not sure which) that allows you to have terms work together so your url would look like:

http://www.ereadingsource.com/custom_path/1+3+5 (in all categories 1, 3, and 5)
http://www.ereadingsource.com/custom_path/1,3,5 ( in any of the categories 1, 3, or 5 )

Which would return those taxonomy categories back into the view.

maybe flip flop those, either

cmcintosh's picture

maybe flip flop those, either way once you find the tick box you will understand as it explains it fully.

Yup you can create another

gideon_ph's picture

Yup you can create another view and set taxonomy term ids as arguments. Arguments can be comma separated. So in my example you will have to link to the URL path of the view and dynamically add the arguments.

If this still doesn't accomplish it, and if you would be dealing with large data. You can explore using apache solr with faceted search.

Thanks for everyones help!

dreadstar's picture

Thanks for everyones help! Everyone was correct the first time around ... views module could actually do what I wanted. I toyed with it a lot more over the weekend and found a working solution. I had to use filters on my taxonomy terms and set them to "exposed".

Thank you very much,

borrico1965's picture

Thank you very much, dreadstar, for posting the resolution to your query after people suggested ways and means to solve it. I think by posting the resolution and closure to this post, it will greatly help others who find themselves in similar situation. Kudos to you and to the generous users who came forward to help out.

I am quite grateful to the

dreadstar's picture

I am quite grateful to the generous experts taking time to look at my problems and spending time to comment. I am not a programmer but do have decent "google" skills. Usually just giving me a clue on the right direction goes a long, long way. Tnx!!!

My Level

tg3793's picture

dreadstar - I'm glad to find somewhere here at about my same skill level. About eleven or twelve years ago someone else referred to me as a Google Master (yes Google was around then) and I have tagged myself in recent years as a Google-ologist :-)

Seeing that you've been around here for a couple of years gives me hope that I might run into you at a meeting and you'll ask the same kind of questions that I too can learn from. Thanks for you input.

... Timothy L. Gott

~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Truth, Eternal Relevance, and IT Stuff.

Philippines

Group organizers

Group categories

Post category

Group notifications

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

Hot content this week