Needs work
Project:
Creative Commons
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
12 Aug 2009 at 00:19 UTC
Updated:
29 Aug 2012 at 19:08 UTC
Jump to comment: Most recent file
Comments
Comment #1
balleyne commentedhook_search() has been implemented by copying significant portions of code from node_search() and added a Creative Commons filter. Ideally, this filter option should just be part of the node_search()'s advanced search, but it's not clear to me how to accomplish that... it's really easy to add the additional fields, but it's not obvious how to add the filter into node_search, since the function explicitly checks for keys (of which CC is not one...).
This implementation ought to work in the meantime, but it should be integrated with node_search() (rather than duplicated) once we figure out how to do that...
Comment #2
turadg commentedCan you make a License facet for faceted search?
Comment #3
c-c-m commentedgreat!
Comment #4
toemaz commentedFind attached contrib module which implements 2 apachesolr hooks for the cc->name field. It will be available as a facet block.
Just coded, not tested at all, but I thought to throw it out there already.
Comment #5
toemaz commentedChanging title.
Comment #6
toemaz commentedPrevious implementation was not good since it hooked into CCK rather than implementing the right hooks. Copied over implementation from apachesolr_og and adapted.
Comment #7
toemaz commented@balleyne
For the moment, I used the cc->name as facet field, but I have the feeling that this is not good. An alternative is to use the cc->license_uri which is also used by the core search implementation in the cc module. However, defining the facet value should not come from what data is available, but rather what you wish to display to the 'end' user.
When looking to the Flickr advanced search form, it is presented as followed:
screenshot
So, it might be good to use to use the same kind of solution for facets or perhaps even a combination of two facets:
- what one can do with it (end users) which is used for search, similar to http://www.flickr.com/search/advanced
- the real specific license which can be used for browse, similar to http://www.flickr.com/creativecommons
Any opinion?
Comment #8
turadg commentedI looked the code over and committed it. I don't have Solr set up to test it out but I successfully enabled it. I'm calling it Fixed for the 1.0 release. If it has bugs for people they can report them on new tickets.
Comment #9
toemaz commentedHola, I wouldn't commit it yet. It need much more work. Just leave it in the queue until someone picks it up and further extends it.
Comment #10
cfennell commentedI will just verify that @toemaz's module indexes and presents a cc facet as expected (fresh Drupal, apachesolr 1.x series, cc installs).
For fun and diversion, I am attaching an extended version that includes an apachesolr advanced search option to limit on cc licensed materials just as an example of how you might accomplish that w/apachesolr (it wasn't clear to me from the issue if the request was for apachesolr search, core search or both). Note: licensed/non-licensed was derived based on whether or not I saw a cc->url w/in the node object during indexing. Not knowing too much about the CC module, I can't say whether or not that is a reliable method to make this determination.
There are a quite a number of string fields that the cc module maintains, and it would be trivial to offer them as possible facets as @toemaz has done with the name field.
Good luck!
Comment #11
toemaz commentedOk, time to get this module from under the dust.
Checking http://search.creativecommons.org gives a good idea on what the CC movement is considering the right search implementation. So we would need 3 search filters:
1. cc or not
2. use for commercial purposes
3. modify, adapt, or build upon
Indexing CC license with a bitfield is not done apparently.
Instead, we could store the on value like: CC BY SA
So to map it to the filters we need:
1.
fq=licence:CC2.
fq=licence:(CC AND -NC)3.
fq=licence:(CC AND -ND)2 & 3.
fq=licence:(CC AND -ND AND -NC)Does this make sense?
Comment #12
kreynen commentedIn D7 I removed the Apache Solr submodule from the project since we're still dealing with issues in the core module update. Do you think it would make more sense to spin this off into it's own project?
Comment #13
turadg commentedon other projects now, can't work on this anymore.
Comment #14
toemaz commentedI have coded what's explained in #11 and it seems to be working. What is left now is to make a form to expose the CC filter (as on search.creativecommons.org ) for advanced search and finally alter the apachesolr query. i'll attach it when ready.
Sure, I'll spin it off in it's own module.