SearchJanitor.updateFTSStuffForGuestBookEntry(this);
SearchJanitorUtils.getTokensForIndexingOrQuery(...);
List searchResults = SearchJanitor.searchGuestBookEntries(searchString, pm);
StringBuffer queryBuffer = new StringBuffer(); queryBuffer.append("SELECT FROM " + GuestBookEntry.class.getName() + " WHERE "); Set queryTokens = SearchJanitorUtils .getTokensForIndexingOrQuery(queryString, MAXIMUM_NUMBER_OF_WORDS_TO_SEARCH); List parametersForSearch = new ArrayList(queryTokens); StringBuffer declareParametersBuffer = new StringBuffer(); int parameterCounter = 0; while (parameterCouter < queryTokens.size()) { queryBuffer.append("fts == param" + parameterCounter); declareParametersBuffer.append("String param" + parameterCounter); if (parameterCounter + 1 < queryTokens.size()) { queryBuffer.append(" && "); declareParametersBuffer.append(", "); } parameterCounter++; } Query query = pm.newQuery(queryBuffer.toString()); query.declareParameters(declareParametersBuffer.toString()); List result = (List) query .executeWithArray(parametersForSearch.toArray());
Demonstrate your proficiency to design, build and manage solutions on Google Cloud Platform.