Jump to:
| Project: | Faceted Search |
| Version: | 6.x-1.0-beta2 |
| Component: | General |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed (duplicate) |
| Issue tags: | faceted_search, facets, revision, revisions, taxonomy |
Issue Summary
On our faceted search landing page, we have a taxonomy facet turned on. That facet says that there are 9 items associated with a particular taxonomy term.
However, when I click on the taxonomy term, it returns 10 results. After I isolated why there was a difference in results, I found that the extra record in the search results should not have been showing up. It wasn't assigned to the taxonomy term.
Further inspection revealed that the node used to be assigned to that particular taxonomy in a previous revision, but was no longer assigned to that term. I deleted the old revision that referenced the taxonomy term and after deleting it, the node no longer showed up in the search results (as is expected).
I've marked this as critical because it breaks the core revisioning feature. I checked to see if the same behavior existed with edits to the node body, but in that case, the search results do seem to be only searching the current revision. I haven't tested other aspects, but for the moment, I'm assuming this is limited to taxonomy.
Comments
#1
Newer (still in draft) revisions are also affecting results.
Apparently, the Faceted Search module scans the term_node table without paying attention to the version of the node that is actually published. It apparently considers all category-node maps that appear there, regardeless if that version of map is published or not.
This is definitively critical in my opinion because it returns wrong unexpected results.
#2
Subscribe
Here is a example sql code which is produced by faceted_search:
SELECT DISTINCT(n.nid) AS nid FROM {node} AS n INNER JOIN {taxonomy_facets_term_node} AS term_node_919 ON n.nid = term_node_919.nidINNER JOIN {taxonomy_facets_term_node} AS term_node_938 ON n.nid = term_node_938.nid
INNER JOIN {term_node} AS term_node_987 ON n.nid = term_node_987.nid
WHERE ((n.status = 1) AND (n.type IN ('foo')) AND (term_node_919.tid = %d) AND (term_node_938.tid = %d) AND (term_node_987.tid = %d)) AND n.nid IN (VIEWSQUERY) GROUP BY n.nid ASC
If this is converted to
SELECT DISTINCT(n.nid) AS nid FROM {node} AS n INNER JOIN {taxonomy_facets_term_node} AS term_node_919 ON n.nid = term_node_919.nidINNER JOIN {taxonomy_facets_term_node} AS term_node_938 ON n.vid = term_node_938.vid
INNER JOIN {term_node} AS term_node_987 ON n.vid = term_node_987.vid
WHERE ((n.status = 1) AND (n.type IN ('foo')) AND (term_node_919.tid = %d) AND (term_node_938.tid = %d) AND (term_node_987.tid = %d)) AND n.nid IN (VIEWSQUERY) GROUP BY n.nid ASC
this should fix it...
#3
I think I am running into a result of this same problem. A node had a taxonomy term assigned to it, and then the node was revised to not have that term. But it is still showing up in the search results, which is definitely wrong.
I tried rebuilding the taxonomy terms index, but it didn't help at all.
#4
Oh wait. What I'm seeing is on this issue, which I reported quite a while back and it has a patch. So at least for now, I'm changing this to duplicate. If it's not the same issue, or if the patch there doesn't fix your problem, feel free to change it back.
#1034006: Results from previous node revisions being returned