WEEK 8: ENTRY 3

 At my internship today, I continued working on the HTTPS GET request to the elasticsearch api. Having constructed my elasticsearch query in the Elasticsearch console, I just needed to use that query and pass it to my elasticsearch api call in my intelliJ code. The goal is to use the list of hostnames I queried from Big Query and get their metadata from the elasticsearch api. I used the olivere elasticsearch package because it is compatible with my http client. So too, I would just have to use the package’s functions to make the Get request to the api. 


After writing the Get request function and passing the list of hostnames and pushing my code to Gitlab, it did not work on the first try. The data format is returned was in byte format and I would like to have it in Json readable format. Thus, I iterate through that array of byte data and convert them into json. However, the elasticsearch olivere package size can only take 10,000. This is a big issue  for my case because the hostnames could be more than 140,000 and having a default size of 10,000 is definitely not a good case for me. So my next step is to figure out how I would work around that. I might have to make multiple api calls each time instead of a bulk request. 


Generally, the day was very insightful because I got to use my knowledge about the olivere package and use it to make the api call. It was a very fast resolution because while I was waiting on the other team to give me authorization to make the api call, I spent some time reading the documentation on that package, and that seems to pay off. Besides, I learned through the process that I should have double checked if the size of the package function would accept more than the default size. In the future, I would read more on a package’s function and see it’s deem fit to be use in my use case.


Comments

Popular posts from this blog

WEEK 4: ENTRY 3

WEEK 6: ENTRY 3

WEEK 7: ENTRY 1