Comment 12 for bug 784222

Revision history for this message
Chris Rossi (chris-archimedeanco) wrote :

Ok, I have completed this on a branch which is ready for testing on branch5:

https://karlstaging.gocept.com/branch5/osf/

This involved some refactoring, which I'll try to discuss briefly at a high level:

1) The "types" in the left sidebar of the search results page now use the same machinery as the groupings in live search. This means that a grouping in the search results can now execute an arbitrary catalog query. Previously the types were tied to a particular content type and couldn't be used to perform any queries more elaborate than just the content type.

2) The catalog now has a new index that tracks the content types of the folders a document is contained in. This opens a new type of query that can be performed, eg "give me any documents contained inside of a reference manual."

These refactors were required to create the "Reference Manuals" type that is clickable from the sidebar of the search results page. Much care was taken to preserve all current functionality with regards to the other types in the sidebar, as well as the relationship between types in the livesearch and types on the search results page. So everything besides the new "Reference Manuals" link should function exactly as before, but because the way these work underneath the hood has been fundamentally altered, it is worth spending some extra testing effort verifying this is the case.

This also, now, opens up the possibility of altering the behavior of search in ways not previously possible. For example, it is now possible to create a "Blogs" search type that searches for blog entries and blog comments but not forum comments. Because all comments, be they blog comments or forum comments, have the same content type in Karl, this was not possible previously as a search for comments would necessarily return comments from anywhere on the site. One possible upshot of this is we could get rid of the (probably seldom used) "Comments" type and enhance the "Blogs" and "Forums" types to include comments contained in their respective types.