private void searchRequest(){
        int action = 0;
        boolean flagNoResult = true;
        try {
            BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
            for (; ; ) {
                System.out.println("Please Choose an action: ");
                System.out.println("1 : new search; 2 : update index; 3 : exit");
                action = getChoosedAction(input);
                if (action == 1) {
                    System.out.println("Please enter your request for new search: ");
                    String str = null, str2 = "";
                    ArrayList<String> results;
                    str = getRequestFromCommandLine(input);
                    //убираем повсюду &
                    Scanner s = new Scanner(str).useDelimiter("&");
                    while (s.hasNext()) {
                        str2 += s.next();
                        if (s.hasNext()) str2 += " ";
                    }
                    //     System.out.println(""+str2);
                    results = search(str2);
                    System.out.println("Result: ");
                    for (int i = 0, count = 1; i < results.size(); i++) {
                        System.out.println(count++ + ": " + results.get(i));
                        flagNoResult = false;
                    }
                    if(flagNoResult) System.out.println("No result");
                    flagNoResult = true;// т.к. в цикле, то надо поставить значение по умолчанию
                    System.out.println("End of search");
                    System.out.println("");
                }
                if(action == 2){
                    renewIndex();
                    System.out.println("Index updated");
                }
                if(action == 3){
                    input.close();
                    System.exit(0);
                }
            }
        }
        catch(IOException ioe){

        }
      //  System.out.println(str);
    }