Is it correct approach to extract fileld data from search response using java?


I am using bool query DSL for searching on index.i have crated gist

what i'm using to retrieve value from index,please correct me if used
approach was wrong and please guide me best approach to be followed.