title: Apply advanced search filter in android while getting data from locally stored Json file, in autocompletetextview / edittext
body: <p>I am kinda new to android with json, and the search.</p>
  
  <p>I want to apply advanced search filter in my autocompletetextview / edittext, in android from json file stored in assets folder.</p>
  
  <p>The json file is consists of FAQs for my app.</p>
  
  <p>And now I want to create advanced search filter like in Google chrome, that if I am typing something like </p>
  
  <blockquote>
    <p>STACK</p>
  </blockquote>
  
  <p>and the predictions I get in URL bar is </p>
  
  <blockquote>
    <p>STACK OVERFLOW</p>
  </blockquote>
  
  <p>next row </p>
  
  <blockquote>
    <p>STACK EXCHANGE</p>
  </blockquote>
  
  <p>etc.</p>
  
  <p>Where </p>
  
  <blockquote>
    <p>stack</p>
  </blockquote>
  
  <p>word is highlighted, with appropriate suggestions.</p>
  
  <p>so, same that way I want to make my search filter that way, because there are some amount of FAQs in my json file, and when user types something like, </p>
  
  <blockquote>
    <p><em>HOW PAPER IS MADE UP OF</em> or <em>METHOD OF PAPER MAKING</em> or <em>WANT TO MAKE
    PAPER OUT OF WASTE</em> or <em>ETC.</em> </p>
  </blockquote>
  
  <p>I hope that you got my point, and now here from given hints,
  the words <em>made up, making, make</em>, all should be meant for <em>MAKE</em>, a root word for all of them.</p>
  
  <p>Because my FAQ has questions and related answers (obviously), so questions might be in long format, so to retrieve best similar response, I want to create the advanced search filter.</p>
  
  <p>So, my question is, </p>
  
  <blockquote>
    <p>IS THERE ANY PARTICULAR API OR ALGORITHM THAT I CAN APPLY TO ACHIEVE
    THIS TASK?</p>
  </blockquote>
  
  <p>I have researched for this for last almost 4-5 days..</p>
  
  <p>What I have applied till now for reading json data is as below..</p>
  
  <pre><code>public String loadJSONFromAsset() {
          String json = null;
          try {
  
              InputStream is = getAssets().open("faq.json");
  
              int size = is.available();
  
              byte[] buffer = new byte[size];
  
              is.read(buffer);
  
              is.close();
  
              json = new String(buffer, "UTF-8");
  
          } catch (IOException ex) {
              ex.printStackTrace();
              return null;
          }
          return json;
  
      }
  </code></pre>
  
  <p>and then,</p>
  
  <pre><code>try {
              JSONObject jO = new JSONObject(loadJSONFromAsset());
              JSONArray json = jO.getJSONArray("faq");
              Log.v("faq", "faq");
  
              for (int i = 0; i &lt; json.length(); i++) {
                  final JSONObject e = json.getJSONObject(i);
                  q = e.getString("q");
                  responseList.add(q);
  
                  a = e.getString("a");
  
              }
  
          } catch (JSONException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  </code></pre>
  
  <p>And then I set the arrayadapter.</p>
  
  <p>Even I have worked with custom adapter, but that is not the issue now.</p>
  
  <p>So, now in my search engine, when someone write set of keywords, the code should ignore the articles, adverbs etc.</p>
  
  <p>The questions which are predicted must me sorted in relevance index.</p>
  
  <p>The synonym capturing and sorting capabilities should be there.</p>
  
  <p>Give the importance to recognized word to refine the relevant set of words.</p>
  
  <p>May be able to add taxonomy dictionary.</p>
  
  <p>So, I want this type of code / engine that can achieve the task required.</p>
  
  <p>Even when user click spacebar, the sorting must be refreshed.</p>
  
  <p>Is there any such API / library, that can fulfill the needs?</p>
  
  <blockquote>
    <p>And frankly speaking, I have tried many of the custom filter
    solutions, and ALGOLIA API (not open-source, had trial for 14 days
    only..) and others too, but these are not capable enough to solve my
    need.</p>
  </blockquote>
  
  <p>Therefore, I thank you in advance, if you can help me to achieve my task with suitable solution of api or algorithm or code or idea..</p>
  
  <p>Regards.</p>