WordPress.org

Ready to get started?Download WordPress

Forums

Faceted Search using custom taxonomies (23 posts)

  1. amberwave
    Member
    Posted 3 years ago #

    I am looking to do a faceted search using custom taxonomy terms associated with a custom post type?

    Similar to http://www.newegg.com

    The FACETED SEARCH plugin does this function but only on categories or tags...

    Any help is appreciated.

  2. amberwave
    Member
    Posted 3 years ago #

    Is it possible to edit the FACETED SEARCH plugin to reference custom taxonomies instead of categories or tags?

  3. Jean-Francois Arseneault
    Member
    Posted 3 years ago #

    I would be interested in this as well

  4. AndrewUlrich
    Member
    Posted 3 years ago #

    not sure what you mean by custom taxonomies, but you may be able to achieve it using the new exclude categories/tags functionality in Version 3.2

  5. amberwave
    Member
    Posted 3 years ago #

    Thanks for replying Andrew. "Custom" taxonomies probably wasn't the way to phrase it, I simply mean taxonomies that I would create.

    So, for example if there were a custom post type of "Cars" there may be different taxonomies such as "Price" "Model" or "Color". I am looking for a similar functionality of the FACETED SEARCH plugin above (cheers to you on developing the plugin) that uses taxonomies instead of categories or tags.

  6. AndrewUlrich
    Member
    Posted 3 years ago #

    I haven't messed with taxonomies other than categories and tags, but one thing you might try is changing the word 'category' in lines 40,63, and 141 to the name of your taxonomy, then deactivate and reactivate the plugin and see if you can use the faceted search category widget for your taxonomy. The only problem with this is that you could only use it for one taxonomy at a time. I might need to consider this in a future release- maybe add a dropdown in the widget options to select the taxonomy to display or something; hmm...

    Another option is to rebuild your taxonomy as categories, and use different Faceted Search Category widgets for each root category (Price, Model, Color), while excluding the other categories in each of the widgets. You would also want to take advantage of the new disable feature so people don't search by the word "Price" itself, etc.

  7. AndrewUlrich
    Member
    Posted 3 years ago #

    Oops, nevermind, I guess option 2 wouldn't work as different widgets wouldn't account for each other- they'd have to all be in the same widget, I think...

  8. visionmedia
    Member
    Posted 3 years ago #

    Hi I have been trying to use your plugin, which is great, however I have issues with the lack of support for taxonomies.

    I am trying to use it in conjuction with wp ecommerce. I thought I could use the taxonmy names from wp ecommerce and create a faceted search for my web shop. ie find all products from cat1 that also belong to cat 6.

    Problem is actually getting the search to work for this. I have tried your suggestion of changing the word 'category' (to wpsc_product_category - the taxonomy name in wp ecommerce). However no result. I also noticed another instance of category on line 492, still no fix though.

    Another thing i picked up on was the use of post type. in wp ecommerce the post types used are named wpsc_product, so I tried changing those labels accordingly also and whilst it helped me display the correct list on the widget, the search was broken. Am I missing something?

    Also is there a way to eliminate the search button, instead refresh page everytime a box is checked?

    Any help will be much appreciated.

  9. visionmedia
    Member
    Posted 3 years ago #

    One Problem Down, one to go...

    Just worked out the Taxonomy issue, I was on the right Path, just missed one of the post-type variables.

    But still need some help with the removal of the search button to be replaced by an update each time a box is checked.

  10. AndrewUlrich
    Member
    Posted 3 years ago #

    Great to hear you've solved the harder problem and are left with the easier one! :)

    Firstly, to remove the buttons themselves, you can remove <input type="submit" value="Search"> from line 528. Then, within the <input type="checkbox" tags on lines 593 and 597, put something like onclick="document.forms["faceted-search"].submit();

    Here's more info on using javascript to submit a form:
    http://www.javascript-coder.com/javascript-form/javascript-form-submit.phtml

    And here's more info on the onclick attribute:
    http://www.w3schools.com/jsref/event_onclick.asp

    Good luck!

  11. visionmedia
    Member
    Posted 3 years ago #

    Andrew you are a champ!

    however all I had to add was onClick="submit();

  12. Gennaro Di Fiandra
    Member
    Posted 3 years ago #

    Hi, I don't understand how resolve taxonomies problem.

    The situation is: I have three taxonomies and each of these have more categories.

    Thank's in advance for help.

  13. jiburns
    Member
    Posted 3 years ago #

    Hey VisionMedia... I've gotten everything to work as you except I'm having that broken search as you were. What are those post type variables that need replacing?
    Thanks!!!

  14. justabloke7676
    Member
    Posted 2 years ago #

    This is exactly what I need help with. I'm sure others as well. Since this plugin is for Categories/Posts, I can't use it. As I understand it, posts and categories are used for blogging but most of us today use WordPress for much more than that..rather a full CMS. As a result, custom taxonomies ARE the way searching is being handled by blogging expanded and CMS sites, as others have mentioned.

    I really think this plugin is a amazing. Since a few of you may have rewritten the code to make this work with taxonomies, could guys please release this in the plug-ins area of WordPress for download? I think you'll be surprised how many would download a taxonomy search over category search. Even better if the plug-in could be updated to include both. Would super appreciate it. I really need it and I have no idea how to recode this.

  15. AndrewUlrich
    Member
    Posted 2 years ago #

    Ok, let me see if I can explain it: it sounds like you need to do two things. First, you need to change all references to the term's taxonomy from 'category' to the taxonomy name(s) you need. Second, you need to change the post type from 'post' to the post type(s) you need.

    From a cursory search, it looks like the term's taxonomy is referenced in facetedsearch_add_category (in the POST), facetedsearch_delete_category (in the POST), facetedsearch_activate (in the query), and facetedsearch_category_content (in the query).

    To find all references to post type, just do a word search for post_type.

    Looking this over again, it seems like it should be pretty easy to implement even for multiple categories if you know your post types and taxonomy names. Making it into a configurable option, however, seems like it might be complex.

    If anyone wants to help me support this code, please let me know, as my own time is quite limited right now.

  16. marco82ger
    Member
    Posted 2 years ago #

    But posting directly the code instead of explaining 100 times was not better?
    Cheers

  17. justabloke7676
    Member
    Posted 2 years ago #

    Sorry for the late response. Must have missed it. Perhaps I can be a bit more clear. I guess you could say that categories and taxonomies are the same so you could change the name. I organize my site using taxonomies through a free plugin called types (wp-types.com). I also use the Views as well. The issue here is that I can create and organize each category and subcategories of the taxonomy very easily and its VERY SEO friendly AND it's not limited to only posts. Types lets you create as many Custom Post Type categories (CPTs)as you want with linking subcategories. It also lets you do all this inside Pages, Media or whatever you want. It's not limited to Posts. If you want to see what I'm talking about, you can try the types plugin. Should work brilliantly with faceted searching.

    I'd love to help you but I'm very much a rookie and have zero coding experience. If there are non coding things I can help you with, let me know. I'll try to help out.

  18. smeyer012
    Member
    Posted 2 years ago #

    I was able to edit the plugin to work for one custom taxonomy within a custom post type (using version 3.4.4) but I am definitely interested in getting it to work for multiple taxonomies (within the same custom post type). I am able to just hard-code those taxonomies, but I'm not entirely sure how to modify the code to make it work.

    Suggestions would be greatly appreciated! :-)

    Thanks in advance.

  19. xInd.ca
    Member
    Posted 2 years ago #

    I am also looking to make this same kind of thing work. I need a custom search box that will allow for selecting check-boxes based on custom taxonomies so that users can just select a product type, then price range, color, size, etc and have it display all the 'posts' that match those criteria. I thought I had already seen this before, but maybe nobody has done it yet...?
    Well, I will be working on the code if I don't find a solution, but my php skills are quite rusty, so if anyone has found a solution it would be greatly appreciated.
    Andrew - I will do my best to help!

  20. Bryce Corkins
    Member
    Posted 2 years ago #

    I'm working on this right now... http://wordpress.org/extend/plugins/wp-ultimate-search/ . Needed it for a client and there weren't any plugins that did the trick.

    Only supports faceting by categories currently, but faceting by tags, users, custom post types, and unlimited post meta (including advanced custom fields) will be available within the next few days.

    Would love to get your suggestions if you have a chance to try it out

  21. Jean-Francois Arseneault
    Member
    Posted 2 years ago #

    Hey Sekatsim, this looks good, I like the modern look and functionality.

    I'm really busy right now, but if your plugin can allow someone to filter/search from multiple dropdowns, which are dynamically populated from existing custom taxonomies, let me know, I'll be glad to take it for a spin and give you a detailed review!

  22. annacox024
    Member
    Posted 2 years ago #

    Hi Sekatsim,

    Just wondering when the faceting by post meta feature of your plug in will be available. I have downloaded and cannot find any feature other than a plain search - pretty sure i'm missing something. help?

  23. Bryce Corkins
    Member
    Posted 2 years ago #

    It's in the works.. the plugin is almost ready for release, but we're still working out the kinks in the upgrade / authentication process, plus developing our support site, etc.

    I'm hoping it'll be out within the next couple of weeks.. maybe sooner. I'll post an update here once it's ready.

Topic Closed

This topic has been closed to new replies.

About this Topic