Posted by Julio Barros on March 5, 2008 at 7:17pm
| Project: | Apache Solr Search Integration |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
As an example
Fruit
-- apple
-- golden delicious
Comments
#1
This patch for apachesolr.module puts the all the terms ancestors in the index; this means that searching for "Fruit" will bring up nodes tagged "apple" OR "golden delicious" (as per the above example). However, the display for Filtering by that facet is still flat.
#2
Thanks! Will review as soon as I can.
#3
Sorry, did not mark as "patch needs review"! Probably got lost among other issues.
By the way I have a strategy for having complete hierarcical support: build an in-memory data structure for building facet blocks, instead of building HTML as we go. This way we can relate hierarchical terms when building the data structure and later let another function handle theming. The theming function would handle cases like hierarchical facets... the case for flat vocabularies might look a lot (in code) like the current functions.
Any pointers to existing code or Drupal functions that do this are appreciated...
#4
janusman - I'm waivering on marking this "critical" for 1.0 roadmap. What do you think?
#5
Hmm I think it's a bug not to find stuff that *is* there (search for "fruit" should bring nodes labeled "fruit > apple" and "fruit > orange")... so I still vouch for the 1.0 release at least indexing the terms, and if possible also adding some theming function to explicitly show the user the hierarchical relationships in the facet's block.
#6
Ok. I'm easy to convince (sometimes =)
Can you please confirm that the patch still applies and is ready for review? And perhaps work on a D6 patch too?
#7
Here's a D5 patch that I feel pretty comfortable with. Thoughts?
#8
Had forgotten to save latest version... more code comments.
#9
Uhm, testing the patch I just figured out that we realy need to add tids, vids, imfield_vid*s and taxonomy_names for parent AND children. If we don't then a search for term id for "fruit" will show facets for the children (e.g.: apples, oranges) but not for the parent term.
taxonomy_get_parents_all() returns the current term info as well as its parent's.
New patch below for D5.
Also, a screenshot; this was for a search for term "Science" in a test library catalog. To me this seems the correct behaviour (although In the near future I see the display as showing relationships instead of the current flat listing) Live example here:
http://prod68ws.ruv.itesm.mx/dev/5/search/apachesolr_search/+tid%3A184
#10
Committed to DRUPAL-5 and DRUPAL-6--1. Thanks!
#11
Automatically closed -- issue fixed for two weeks with no activity.