title: Trying to use the GET API to retrieve single term with elasticsearch and the JAVA API
body: <p>I am new to elasticsearch but I am very close to getting the term, but I'm missing some small detail and I can't figure out what it is.</p>
  
  <pre><code>GetRequest getRequest = new GetRequest("registered", "users", id);
              client.get(getRequest);
  
              getRequest.storedFields("age"); 
              GetResponse getResponse = client.get(getRequest);
              String pw = getResponse.getField("age").getValue();
              writer.println(getRequest);
  </code></pre>
  
  <p>When I try to run the above code I get a "nullPointerException". I have looked over the doc for the GET API <a href="https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-document-get.html" rel="nofollow noreferrer">https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-document-get.html</a> but am getting nowhere. Any help someone could provide would be greatly appreciated.</p>