Closed antrromet closed 8 years ago
super awesome.
Thanks a lot @antrromet I will add code to save/pull metadata fields to/from the admin core.
Thanks for contribution.
please merge :+1:
@antrromet I merged your changes but there are some issues with it.
Seems like there is no cross domain support. Error on js console -
Failed to load resource: the server responded with a status of 404 (Not Found)
XMLHttpRequest cannot load http://localhost:8983/solr/new_core//select?q=id:%22undefined%22&wt=json&indent=true. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8000' is therefore not allowed access. The response had HTTP status code 404.
Also can you make it fail safe? so even if we are not able to fetch fields from index we still see the old popup?
@MBoustani Lets not redeploy till this is fixed.
I fixed the fail safe part. 8f7035d
Also I will suggest using jsonp for this. I saw you used XMLHttpRequest, I will recommend using jquery ajax with datatype "jsonp".
I this this is how it's done in facetview. https://github.com/chrismattmann/facetview/blob/master/jquery.facetview.js#L1364
Key is jsonp: "json.wrf"
Let me know if you think otherwise
@smadha Oops. I guess am a little late. Even I did the exact same thing and made another pull request. That can be ignored now.
@smadha @chrismattmann As per our discussion I've added the code for the popup content to show more metadata fields. I think the code is very self explanatory.
As of now I've hard coded the fields here. We will have to change this so as to get the metadata fields from the solr index.
Also, I've added a simple UI in the index.html file here for the metadata fields.
Let me know if you have any doubts.