Needs work
Project:
Apache Solr Attachments
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
8 Jul 2010 at 20:02 UTC
Updated:
7 Jun 2013 at 16:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedSubscribing
Comment #2
wmostrey commentedRobert wrote a complete guide with an example module on how to do this: Understanding the ApacheSolr CCK API
Comment #3
wmostrey commentedShould we include Robert's custom module (and use this issue), or keep it as a guide (and close this issue)?
Comment #4
jpmckinney commentedI think we should leave it as a guide.
Comment #5
pwolanin commentedI'd be happy to roll the code in some day, but is not a priority for me at the moment.
Comment #6
jpmckinney commentedI wrote the code for the 7.x port, but following Robert's guide actually creates a facet for nodes, not for files, FYI.
Comment #7
jpmckinney commentedFor D7, the issue is with apachesolr_entity_fields. You can pass it an $entity_type, but for search it will almost always be "node". And the fields that field_info_fields() returns will usually be tied to only the node bundle. I don't think it makes sense to create a "file" bundle just to make it easier for apachesolr_attachments to implement facets. So, implementing hook_apachesolr_field_mappings, which apachesolr_entity_fields calls, can only really add facet fields for node documents, not file documents. I can create a facet the old-fashioned way, just putting down these thoughts in case someone has a better idea.
Comment #8
jpmckinney commentedOld fashioned alternative (for D7).
Comment #9
pwolanin commentedFor D7 I expect some major refactoring yet around entity indexing and handling.
Comment #10
jpmckinney commented#8 is the patch to review.
Comment #11
wmostrey commented1. Function
apachesolr_default_server()is replace byvariable_get('apachesolr_default_server', 'solr');2. Function
apachesolr_get_enabled_facets()also doesn't exist anymore. We do havevariable_get('apachesolr_enabled_facets', NULL);andfacetapi_get_enabled_facets().Comment #12
wmostrey commentedComment #13
bleedev commentedAn implementation of Facet API to provide for a mimetype Solr facet and filter block I wrote up here.
Comment #14
wmostrey commentedThat's a great article Brandon, thanks. Using file_mimetype_mapping() we could add an automatic filter for each mime, showing the file extension.
Comment #15
zilla commentedit seems that simply "has attachment" would be the logical facet to add (filter out search results for all nodes with attachments upon word search)
further facet by filetype would be awesome - but seems like it should be conditional upon first even having an attachment
Comment #16
nick_vhPlease refactor this patch so it works in the latest D7 code :-)
Comment #17
David_Rothstein commentedIf you're using the File Entity module to define file types, I believe this (mostly) works already - those types will appear as options in the bundle facet just like any other entity bundles. However, see related issue: #2014675: Support for filtering by file type using the Facet API is incomplete