Closed (works as designed)
Project:
Search API
Version:
7.x-1.11
Component:
Views integration
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
11 Feb 2014 at 16:16 UTC
Updated:
13 Apr 2014 at 13:00 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mengi commentedIn your search index, you will have to go to the fields tab and at the bottom click on 'Add related fields'. You will have to add your product reference field first, save, then go back down to 'Add related fields' and add the price field. You should be able to add the price field now. Don't forget to reindex.
As for images, take a look at https://drupal.org/node/1109318. As far as I can tell there isn't a way for the search API to display images through a view. Perhaps with a HTML rewrite?
Comment #2
pyxio commentedThanks for the reply mengi,
Of course I did all of this and it does not work. However, if you check out the Commerce Kickstart distro it works perfectly. You can get images and price as fields. I don't get why this does not work outside of Kickstart though. Perhaps that can help troubleshoot where the problem might be? Cheers Kevin
Comment #3
mengi commentedI meant that there isn't a way to display images using with fields. The only way I know how is to show 'Rendered entity' instead of fields, which is what kickstart uses.
Comment #4
pyxio commentedYes. but in Kickstart if you switch from rendered entity to fields the image field does work if the field_product relationship is configured. My problem is I don't want to use Kickstart and it does not work using the standalone Drupal commerce and search modules. Cheers Kevin
Comment #5
mengi commentedKickstart uses a field called 'rendered node' which shows a view mode (same as showing rendered entity).
Comment #6
pyxio commentedHello,
Here are two screenshots. One shows the view configuration with a image field... not rendered node here. Just the product images. The next screenshot is the view preview which displays the image without any problem. So clearly you display image fields with Search API indexed nodes. The problem is, why does this only work on Commerce Kickstart? Cheers Kevin
Comment #7
mengi commentedYou are using the 'Collection products' view right? I set up the view exactly as you have it and the images didn't show up for me, so I am not sure what you did different to get them to show up. Hopefully someone with more experience with Kickstart can chime in.
Comment #8
pyxio commentedHi.. it works for me on both a local version of kickstart and a version on pantheon. So I am completely perplexed by this. Yeah, hopefully somebody can help make some sense of this.
Comment #9
drunken monkeySorry, I'm not using Drupal Commerce so I can't really help you there.
But please read and follow the issue tag guidelines.
Comment #10
pyxio commentedLet's forget about Drupal Commerce for a moment. Why is that search API will index image fields and display fine as a rendered node in a view... but not as a field? What is the reason for this? It seems to me if images appear in a rendered node they should also appear as a field. My preferred approach to theming is rewriting views fields... OK, I get this is apparently not possible for a search api indexed node... but my question remains why? i just need to understand from a technical perspective why a rendered node shows an image but a field does not. I will look into a different method for theming my product display due to this, but I am just curious because it just doesn't seem to make sense to me. Either search api indexes images or it doesn't. but we know it does. so why are they not available in as a field? thanks. Kevin
Comment #11
drunken monkeyThe indexing/searching processes and the Views display/rendering processes are actually more or less completely separate. Something being indexed doesn't really mean that it will display fine in Views.
Also, in a quick test this works perfectly fine for me: I just add the image field as a field in Views and it's there, with all the Field API formatter options normally associated with it. So I can't really say what goes wrong in your case.
Comment #12
pyxio commentedThis appears to be solved by ensuring that you are using entity module https://drupal.org/project/entity version 7.x-1.5. Please see this thread https://drupal.org/node/2190977 for more info and a big thanks to Ichang https://drupal.org/user/2519980 for his support in this critical issue. Good luck!!
Comment #13
pyxio commented