@Test public void testParse() { try { final SelectParserSingle request1 = new SelectParserSingle(); request1.parse(EX_BOTH_ES_MD); assertTrue("Should refuse the request since ES is not allowed", request1.hasFullTextQuery()); request1.parse(EX_MD); assertFalse("Should accept the request since ES is not allowed", request1.hasFullTextQuery()); } catch (final Exception e) {} try { final SelectParserSingle request1 = new SelectParserSingle(); request1.parse(EX_BOTH_ES_MD); assertNotNull(request1); assertTrue("Should refuse the request since ES is not allowed", request1.hasFullTextQuery()); final Select select = new Select(); select.setQuery(path("id1")); select.setQuery( and().add(exists("mavar1"), missing("mavar2"), isNull("mavar3"), or().add(in("mavar4", 1, 2).add("maval1"), nin("mavar5", "maval2").add(true)), not().add(size("mavar5", 5), gt("mavar6", 7), lte("mavar7", 8), gte("mavar7", 8), lt("mavar7", 8)), not().add(eq("mavar8", 5), ne("mavar9", "ab"), range("mavar10", 12, true, 20, true)), matchPhrase("mavar11", "ceci est une phrase"), matchPhrasePrefix("mavar11", "ceci est une phrase") .setMatchMaxExpansions(10), flt("ceci est une phrase", "mavar12", "mavar13"), mlt("ceci est une phrase", "mavar12", "mavar13"), and().add(search("mavar13", "ceci est une phrase"), wildcard("mavar13", "ceci"), regex("mavar14", "^start?aa.*")), and().add(term("mavar14", "motMajuscule").add("mavar15", "simplemot")), and().add(term("mavar16", "motMajuscule").add("mavar17", "simplemot"), or().add(eq("mavar19", "abcd"), match("mavar18", "quelques mots"))), regex("mavar14", "^start?aa.*"))); select.setLimitFilter(100, 1000).addHintFilter(FILTERARGS.CACHE.exactToken()); select.addOrderByAscFilter("maclef1") .addOrderByDescFilter("maclef2").addOrderByAscFilter("maclef3"); select.addUsedProjection("#dua", "#all"); final SelectParserSingle request2 = new SelectParserSingle(); request2.parse(select.getFinalSelect()); assertNotNull(request2); final Query query1 = request1.getRequest().getQuery(); final Query query2 = request2.getRequest().getQuery(); if (!query1.toString().equals(query2.toString())) { System.err.println(query1); System.err.println(query2); } assertTrue("TypeRequest should be equal", query1.toString().equals(query2.toString())); assertTrue("Projection should be equal", request1.getRequest().getProjection().toString() .equals(request2.getRequest().getProjection().toString())); assertTrue("OrderBy should be equal", request1.getRequest().getFilter().toString() .equals(request2.getRequest().getFilter().toString())); assertEquals(request1.hasFullTextQuery(), request2.hasFullTextQuery()); assertEquals(request1.getRequest().getFinalSelect().toString(), request2.getRequest().getFinalSelect().toString()); assertTrue("Command should be equal", request1.toString().equals(request2.toString())); } catch (final Exception e) { e.printStackTrace(); fail(e.getMessage()); } }
@Override public void parse(final JsonNode request) throws InvalidParseOperationException { parseJson(request); internalParseSelect(); }
SelectParserSingle extends RequestParserSingle { @Override public void parse(final JsonNode request) throws InvalidParseOperationException { parseJson(request); internalParseSelect(); } }
SelectParserSingle extends RequestParserSingle { @Override public void parse(final JsonNode request) throws InvalidParseOperationException { parseJson(request); internalParseSelect(); } SelectParserSingle();  SelectParserSingle(VarNameAdapter adapter); }
SelectParserSingle extends RequestParserSingle { @Override public void parse(final JsonNode request) throws InvalidParseOperationException { parseJson(request); internalParseSelect(); } SelectParserSingle();  SelectParserSingle(VarNameAdapter adapter); @Override void parse(final JsonNode request); @Override void parseQueryOnly(final String query); void projectionParse(final JsonNode rootNode); void addProjection(final ObjectNode slice, final ObjectNode allFields); @Override Select getRequest(); }
SelectParserSingle extends RequestParserSingle { @Override public void parse(final JsonNode request) throws InvalidParseOperationException { parseJson(request); internalParseSelect(); } SelectParserSingle();  SelectParserSingle(VarNameAdapter adapter); @Override void parse(final JsonNode request); @Override void parseQueryOnly(final String query); void projectionParse(final JsonNode rootNode); void addProjection(final ObjectNode slice, final ObjectNode allFields); @Override Select getRequest();  }