/** * Enables preview for this job (although it might slow search * considerably). * * @return The search job. */ public Job enablePreview() { return control("enablepreview"); }
/** * Pauses the current search. * * @return The search job. */ public Job pause() { return control("pause"); }
/** * Performs the requested action on this job. Valid values are: "pause", * "unpause", "finalize", "cancel", "touch", "setttl", "setpriority", * "enablepreview", and "disablepreview". * * @param action The action to perform. * @return The search job. */ public Job control(String action) { return control(action, null); }
/** * Disables preview for this job. * * @return The search job. */ public Job disablePreview() { return control("disablepreview"); }
/** * Stops the job and provides intermediate results available for retrieval. * * @return The search job. */ public Job finish() { return control("finalize"); }
/** * Stops the current search and deletes the result cache. * * @return The search job. */ public Job cancel() { try { return control("cancel"); } catch (HttpException e) { if (e.getStatus() == 404) { // Already cancelled; cancel is a nop. } else { throw e; } } return this; }
/** * Sets this job's priority in the range of 0-10. * * @param value The new priority. */ public void setPriority(int value) { checkReady(); control("setpriority", new Args("priority", value)); }