/** * @deprecated use DefaultSolrHighlighter * @see DefaultSolrHighlighter#isHighlightingEnabled */ public static boolean isHighlightingEnabled(SolrQueryRequest request) { return HIGHLIGHTER.isHighlightingEnabled(getParams(request)); }
Formatter getFormatterX(String fieldName, SolrQueryRequest request) { return getFormatter(fieldName, HighlightingUtils.getParams(request)); } Fragmenter getFragmenterX(String fieldName, SolrQueryRequest request) {
int getMaxSnippetsX(String fieldName, SolrQueryRequest request) { return getMaxSnippets(fieldName, HighlightingUtils.getParams(request)); } Formatter getFormatterX(String fieldName, SolrQueryRequest request) {
Fragmenter getFragmenterX(String fieldName, SolrQueryRequest request) { return getFragmenter(fieldName, HighlightingUtils.getParams(request)); } }
/** * Generates a <delete>... XML string for an ID * * @see TestHarness#deleteById */ public static String delI(String id) { return TestHarness.deleteById(id); } /**
/** * Generates a SolrQueryRequest using the LocalRequestFactory * @see #lrf */ public static SolrQueryRequest req(String... q) { return lrf.makeRequest(q); }
/** * Validates an XML "query" response against an array of XPath test strings * * @param request the Query to process * @return null if all good, otherwise the first test that fails. * @exception Exception any exception in the response. * @exception java.io.IOException if there is a problem writing the XML */ public String validateQuery(String request, String... tests) throws Exception { String res = query(request); return validateXPath(res, tests); }
/** * @see TestHarness#optimize */ public static String optimize(String... args) { return TestHarness.optimize(args); } /**
/** Validates an update XML String is successful */ public static void assertU(String message, String update) { checkUpdateU(message, update, true); }
/** * Validates that an "update" (add, commit or optimize) results in success. * * :TODO: currently only deals with one add/doc at a time, this will need changed if/when SOLR-2 is resolved * * @param xml The XML of the update * @return null if successful, otherwise the XML response to the update */ public String validateUpdate(String xml) throws SAXException { return checkUpdateStatus(xml, "0"); }
/** fills the byte[] with static data */ synchronized public void nextBytes(byte[] bytes) { fillData(bytes); } /** NOOP */
/** Validates an update XML String is successful */ public static void assertU(String update) { assertU(null, update); }
/** Validates an update XML String failed */ public static void assertFailedU(String update) { assertFailedU(null, update); }
protected void closeRestTestHarnesses() throws IOException { for (RestTestHarness h : restTestHarnesses) { h.close(); } }
/** * Helper that returns an <optimize> String with * optional key/val pairs. * * @param args 0 and Even numbered args are params, Odd numbered args are values. */ public static String optimize(String... args) { return simpleTag("optimize", args); }
/** * @deprecated use DefaultSolrHighlighter * @see DefaultSolrHighlighter */ public static Highlighter getHighlighter(Query query, String fieldName, SolrQueryRequest request) { return HIGHLIGHTER.getHighlighterX(query, fieldName, request); }
/** Validates an update XML String is successful */ public void assertU(String update) { assertU(null, update); }
/** Validates an update XML String failed */ public void assertFailedU(String update) { assertFailedU(null, update); }
/** Validates an update XML String failed */ public void assertFailedU(String message, String update) { checkUpdateU(message, update, false); }
/** Validates an update XML String failed */ public static void assertFailedU(String message, String update) { checkUpdateU(message, update, false); }