title: How to compare JSONObject with a Query
body: <p>How to compare this:</p>
  <pre><code>search.setName(hits.getJSONObject(i).getString(&quot;name&quot;));
  </code></pre>
  <p>with:</p>
  <pre><code>text.toString()
  </code></pre>
  <p>Can you help me please?</p>
  <p>This is my code</p>
  <pre><code>final Query query = new Query(text.toString())
                      .setHitsPerPage(50); 
  
              index.searchAsync(query, new CompletionHandler() {
                  @Override
                  public void requestCompleted( @Nullable JSONObject content, @Nullable AlgoliaException error) {
  
                     try {
  
                         list.clear(); 
                          JSONArray hits = content.getJSONArray(&quot;hits&quot;);
  
                          for (int i =0; i &lt; hits.length(); i++) {
  
                              Model search = new Model(); 
  
                              search.setName(hits.getJSONObject(i).getString(&quot;nome&quot;));
                              search.setCity(hits.getJSONObject(i).getString(&quot;city&quot;));
                              search.setcountry(hits.getJSONObject(i).getString(&quot;country&quot;));
                             
                              list.add(search);
     
  
                          }
                         searchAdapter.notifyDataSetChanged(); 
  
                      } catch (JSONException e) {
                          e.printStackTrace();
                      }
  
  
                  }
              });
  </code></pre>