header parallax image
uncoditional

code liberated

  • Home
  • Pete
  • Home
  • Pete
AWSCloudSearchColdFusionJavaLanguages

AWS CloudSearch file/data upload using JDK – code sample

November 2, 2017Peter Lombardo8455 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

Angular component code block execution order

March 31, 2022

programming basics/refresher done right

October 31, 2017

cf – create crud from column names.sql

October 9, 2017

Leave a Response Cancel reply

You must be logged in to post a comment.

about me

uncoditional

Pete Lombardo

I like people and coding. Both change. Twenty years of full-stack development. I live in Maryland.

Recent Posts

  •   lives on!
    									
  • Cannot find module ‘…/…’ or its corresponding type declarations.
  • *ngIf – use parentheses
  • Angular component code block execution order
  • material dialog- how to get response data .subscribe()

Recent Comments

    Archives

    • June 2022
    • March 2022
    • 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

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

    Meta

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

    Follow @ Instagram

    Configuration error or no pictures...