CrescentSearchRequestWrapper { public Query getQuery() throws CrescentInvalidRequestException { Query resultQuery = null; String customQueryString = searchRequest.getCustomQuery(); String regexQueryString = searchRequest.getRegexQuery(); if((customQueryString != null && customQueryString.length() > 0) || (regexQueryString != null && regexQueryString.length() > 0)) { CustomQueryStringParser queryParser = new CustomQueryStringParser(); try { resultQuery = queryParser.getQuery(getIndexedFields(), customQueryString, collection.getSearchModeAnalyzer(), regexQueryString); } catch (Exception e) { logger.error("Error In getQuery ", e); throw new CrescentInvalidRequestException(e.getMessage()); } } else { if (getKeyword() == null || getKeyword().length() == 0) { resultQuery = new MatchAllDocsQuery(); return resultQuery; } DefaultKeywordParser queryParser = new DefaultKeywordParser(); resultQuery = queryParser.parse(getTargetSearchFields(), getKeyword(), collection.getSearchModeAnalyzer()); } return resultQuery; } CrescentSearchRequestWrapper(SearchRequest searchRequest); String getKeyword(); String getCollectionName(); int getDefaultHitsPage(); int getPageNum(); int getStartOffSet(); int getHitsForPage(); Sort getSort(); Query getQuery(); Filter getFilter(); List<CrescentCollectionField> getTargetSearchFields(); List<CrescentCollectionField> getIndexedFields(); String getUserIp(); String getUserId(); String getPcId();  }
@Test public void getQuery() throws CrescentInvalidRequestException { SearchRequest searchRequest = new SearchRequest(); searchRequest.setCollectionName("sample"); searchRequest.setCustomQuery("title:\"파이썬 프로그래밍 공부\" +dscr:\"자바 병렬 프로그래밍\""); CrescentSearchRequestWrapper csrw = new CrescentSearchRequestWrapper(searchRequest); Query query = csrw.getQuery(); System.out.println(query); Assert.assertEquals("title:파이썬^2.0 title:파이^2.0 title:프로그래밍^2.0 title:공부^2.0 +dscr:자바 +dscr:병렬 +dscr:프로그래밍", query.toString()); }