@Test public void getSpellCheckQuery() { assertEquals(jcrQuery, handler.getSpellCheckQuery(resolver, "")); }
@Override public Query getSpellCheckQuery(ResourceResolver resourceResolver, String searchTerm) { try { Session session = resourceResolver.adaptTo(Session.class); if (session == null) { return null; } final String queryStr = "SELECT [rep:spellcheck()] FROM [nt:base] as s WHERE [jcr:path] = '" + HistoryUtil.HISTORY_BASE + "' AND SPELLCHECK($searchTerm)"; final Query query = setupQuery(session, queryStr); ValueFactory valueFactory = session.getValueFactory(); query.bindValue("searchTerm", valueFactory.createValue(searchTerm)); return query; } catch (RepositoryException e) { LOG.error("Unable to create spell check query", e); } return null; }
HistorySearchHandler implements OmniSearchHandler { @Override public Query getSpellCheckQuery(ResourceResolver resourceResolver, String searchTerm) { try { Session session = resourceResolver.adaptTo(Session.class); if (session == null) { return null; } final String queryStr = "SELECT [rep:spellcheck()] FROM [nt:base] as s WHERE [jcr:path] = '" + HistoryUtil.HISTORY_BASE + "' AND SPELLCHECK($searchTerm)"; final Query query = setupQuery(session, queryStr); ValueFactory valueFactory = session.getValueFactory(); query.bindValue("searchTerm", valueFactory.createValue(searchTerm)); return query; } catch (RepositoryException e) { LOG.error("Unable to create spell check query", e); } return null; } }
HistorySearchHandler implements OmniSearchHandler { @Override public Query getSpellCheckQuery(ResourceResolver resourceResolver, String searchTerm) { try { Session session = resourceResolver.adaptTo(Session.class); if (session == null) { return null; } final String queryStr = "SELECT [rep:spellcheck()] FROM [nt:base] as s WHERE [jcr:path] = '" + HistoryUtil.HISTORY_BASE + "' AND SPELLCHECK($searchTerm)"; final Query query = setupQuery(session, queryStr); ValueFactory valueFactory = session.getValueFactory(); query.bindValue("searchTerm", valueFactory.createValue(searchTerm)); return query; } catch (RepositoryException e) { LOG.error("Unable to create spell check query", e); } return null; }  }
HistorySearchHandler implements OmniSearchHandler { @Override public Query getSpellCheckQuery(ResourceResolver resourceResolver, String searchTerm) { try { Session session = resourceResolver.adaptTo(Session.class); if (session == null) { return null; } final String queryStr = "SELECT [rep:spellcheck()] FROM [nt:base] as s WHERE [jcr:path] = '" + HistoryUtil.HISTORY_BASE + "' AND SPELLCHECK($searchTerm)"; final Query query = setupQuery(session, queryStr); ValueFactory valueFactory = session.getValueFactory(); query.bindValue("searchTerm", valueFactory.createValue(searchTerm)); return query; } catch (RepositoryException e) { LOG.error("Unable to create spell check query", e); } return null; }  @Override String getID(); @Override Resource getModuleConfig(ResourceResolver resourceResolver); @Override List<PredicateSuggestion> getPredicateSuggestions(ResourceResolver arg0, I18n arg1, String arg2); @Override SearchResult getResults(ResourceResolver resolver, Map<String, Object> predicateParameters, long limit, long offset); @Override Query getSpellCheckQuery(ResourceResolver resourceResolver, String searchTerm); @Override Query getSuggestionQuery(ResourceResolver resourceResolver, String searchTerm); }
HistorySearchHandler implements OmniSearchHandler { @Override public Query getSpellCheckQuery(ResourceResolver resourceResolver, String searchTerm) { try { Session session = resourceResolver.adaptTo(Session.class); if (session == null) { return null; } final String queryStr = "SELECT [rep:spellcheck()] FROM [nt:base] as s WHERE [jcr:path] = '" + HistoryUtil.HISTORY_BASE + "' AND SPELLCHECK($searchTerm)"; final Query query = setupQuery(session, queryStr); ValueFactory valueFactory = session.getValueFactory(); query.bindValue("searchTerm", valueFactory.createValue(searchTerm)); return query; } catch (RepositoryException e) { LOG.error("Unable to create spell check query", e); } return null; }  @Override String getID(); @Override Resource getModuleConfig(ResourceResolver resourceResolver); @Override List<PredicateSuggestion> getPredicateSuggestions(ResourceResolver arg0, I18n arg1, String arg2); @Override SearchResult getResults(ResourceResolver resolver, Map<String, Object> predicateParameters, long limit, long offset); @Override Query getSpellCheckQuery(ResourceResolver resourceResolver, String searchTerm); @Override Query getSuggestionQuery(ResourceResolver resourceResolver, String searchTerm);  }