Closed (outdated)
Project:
Search API
Version:
7.x-1.x-dev
Component:
Views integration
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
9 May 2014 at 14:59 UTC
Updated:
10 Jan 2019 at 08:46 UTC
Jump to comment: Most recent
Comments
Comment #1
giorgio79 commented#1109318: Views: Add option to display image fields as image
Comment #2
giorgio79 commentedHmm, it looks like I am having problems with images in referenced entities. I am not getting the formatter option there, and can only index the image file, not the entire field.
Comment #3
MickC commentedUsing 'Add Related Fields' only allows adding the image file entity field, not 'its' own fields - these can be added as further Related Fields.
Views can access the fields, but seems to handle them differently and there's different issues with each.
In my case the node is 'Event' with a referenced entity 'Artist' which has an image field.
I can add a single field related to the Artist 'Artist » Image » The file.'
Then I can add all the fields related to that e.g. 'Artist » Image » The file. » File name', 'Artist » Image » The file. » URL' - note that delta is not available.
Indexing works and the fields can be viewed in Solr.
Views can see the fields and they can be added but there are issues - of course using Relationships to add the image actually works, but the whole point of Solr to get the full performance benefit is to avoid using the database. This is as far as I can get using Solr field sonly:
'Artist » Image » The file' does not display data - commas appear if there are multiple values.
There's no Multiple Values option - this is needed because it is a multi value field.
Display offers an option to 'Show complete entity' , with a secondary option of 'View Mode'
If this actually worked it would be ideal.
Slightly better luck with the Artist » Image » The file. » URL' field, which can be rewritten to display a single image using #2 here https://drupal.org/node/1109318
However in my case because is is a multi value field, it fails to display if there is more than one.
This could be made to work if we could
a) force the index to only index the first delta value
b) enabled Multiple Values to work on the referenced image field
c) included the Delta field which could then be used as a filter
Seems this is close, if others can chime in on the above...
Comment #4
drunken monkeyYou can do that with the "Aggregated fields" data alteration.
And yes, since the Field API formatters always need the full entity, it is not possible to use them with only the results data from Solr. As far as I can see, there's really no way around that (unless we want to store the complete entity in Solr, but then we'd have effectively re-implemented entity caching).
Also, I don't agree that "the whole point of Solr to get the full performance benefit is to avoid using the database". Solr has huge benefits (also performance-wise) even if you afterwards use the database to load the entities.
Or just use proper entity (and possibly other) caching instead of relying on Solr as a caching system.
Comment #5
legolasboThis issue has not seen activity in over 2,5 years. I am therefore closing this issue to clean up the issue queue. Feel free to re-open and update this issue if you feel this issue is still relevant and of importance.