header parallax image
uncoditional

code liberated

  • Home
  • Pete
  • Home
  • Pete
AWSCloudSearchColdFusionJavaLanguages

AWS CloudSearch file/data upload using JDK – code sample

November 2, 2017Peter Lombardo4662 views

Yet another post to help others both cut to the chase as well as understand a new bit of technology, this one is about using the AWS java JDK for communicating with and in this case, uploading a file to a cloudsearch Domain.

I’ll be brief.  This one took a while for me as the javadocs were not, to me, reflecting the way the code behaved.   In the end, one gotcha i can clue you in on is that there is now a cloudsearch2 package.  I did not use that new one, but that doesn’t mean you shouldn’t.  Just don’t get yourself wrapped around the axel about the documentation’s reference to a endPointConfiguration object.  This quick version simply didn’t need one.

In the end our snippet below  is quite straight forward. It simply :

  1. sets up the credentials
  2. feeds them to our client object
  3. identifies the endpoint and region strings ( in simple examples like this one you simply use the web AWS Console to create  your CS domain).
  4.  use Java i/o functions to create a stream to your simple json file
  5. and fire away!

You can then go and check your results back in the AWS web console, it gives you a good UI for testing your domain’s records.

hth

https://gist.github.com/obxpete/d23d5aadc51f064d9c2933bbc957738a

Note here that I just made up the ID value.  You can figure out your own schema when you do your homework. 🙂

There are many other standard fields as you can find in the documentation. And, you can add your own, as I have with the coid and minimumUserLevel fields.  They are properly indexed fields which you can filter your results on as well.

https://gist.github.com/obxpete/1b055305b0f58898232173d0fe81b69d

hth,

– Pete

  • tweet
previous story

programming basics/refresher done right

next story

Once more into the cloud

Peter Lombardo

Peter Lombardo

Web developer too long.

you might also like

programming basics/refresher done right

October 31, 2017

cf – create crud from column names.sql

October 9, 2017

AWS SNS using JDK – code sample

September 28, 2017

Leave a Response Cancel reply

You must be logged in to post a comment.

about me

uncoditional

Pete Lombardo

I like people and the fun of coding in its ever changing state. I've lived in Maryland since I was 2 months old. Its smells and sounds are like an old glove. But I look forward to coding and blogging wherever I wake up tomorrow. I've spent 20 years as a programmer and IT guy, but have never had more fun with this stuff than I do now.

Recent Posts

  • ChromeBook as Development Environment: YMMV
  • Once more into the cloud
  • AWS CloudSearch file/data upload using JDK – code sample
  • programming basics/refresher done right
  • cf – create crud from column names.sql

Recent Comments

    Archives

    • June 2020
    • June 2019
    • November 2017
    • October 2017
    • September 2017
    • August 2017
    • June 2017
    • June 2015
    • May 2015
    • April 2015
    • October 2014
    • September 2014
    • July 2014
    • June 2014
    • May 2013
    • February 2013
    • January 2013
    • November 2012
    • October 2012

    Categories

    • AWS
    • before the code
    • Browser Support
    • CFML & Mach-II
    • Chromebook
    • ckEditor
    • CloudSearch
    • ColdFusion
    • Java
    • JQuery and CSS
    • Languages
    • Life
    • Projects
    • SNS
    • SQL
    • Tools
    • Uncategorized
    • unCODitional

    Meta

    • Register
    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org
    0
    Followers
    0
    Followers
    0
    Followers
    0
    Followers

    Follow @ Instagram

    Configuration error or no pictures...