简体   繁体   中英

Display Results from AWS CloudSearch Service

I'm trying to figure out a way of displaying the JSON results from AWS CloudSearch. An Example URL is below. Essentially, I'm trying to create a user interface that is easy to use, easy to implement, utilizes the facet functionality. See attached. They have a demo search set up in the console, which is a good example of what I'm looking for. I've looked everywhere and I can't find any insight on how to accomplish this. Any help would be greatly appreciated. Thank you!!

Cheers.

Steve.!

Results Link Example -- http://search-devwesterncpe-g2e7ihsgb6qvtnhs2ofswib4lm.us-west-1.cloudsearch.amazonaws.com/2011-02-01/search?q=hanks&return-fields=actor%2Cdirector%2Ctitle%2Cyear%2Ctext_relevance&rank=-text_relevance

There are many, many ways to do this, because it's JSON data.

One of the strengths of JSON is that your application's language almost certainly offers a library to convert JSON stuctures into native data structures, so you should easily be able to fetch, convert, and then iterate through the results just as you would any other array (list) of key/value pairs (associative arrays, hashes) and style them in your application with minimal effort, once you understand what a simple task you're actually up against.

But another strength of JSON is that it's natively understood by JavaScript, meaning that another alternative is to present it to the browser and let JavaScript style it for you, in/on/at the browser.

One way to do that is answered here on SO .

It seems like the question isn't really anything to do with CloudSearch, specifically. What you are asking is "How do I style JSON data?" That, in turn, is a broad question with many possible answers... such as converting the JSON to XML and then styling it with XSLT. (I'm at least half-kidding with that suggestion, but I've seen it done more than once.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM