stanfordnlp/CoreNLP · error · RuntimeException
'search' must be one of 'iis', 'cg', 'qn' or 'owlqn' or…
Error message
'search' must be one of 'iis', 'cg', 'qn' or 'owlqn' or 'owlqn2': " + srch
What it means
A validation error in TaggerConfig.setProperties: the 'search' training option holds a value outside the supported optimizer set (iis, cg, qn, owlqn, owlqn2), so the training algorithm cannot be selected.
Solutions
- Set -search to iis, cg, qn, owlqn, or owlqn2
- Use the default (qn) by omitting the flag
- Check for typos or extra whitespace in the value
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/edu/stanford/nlp/tagger/maxent/TaggerConfig.java:207 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10).
Data as JSON: /api/errors/183c182d9d3d200c.
Report an issue: GitHub.
Appendix: source
Thrown at src/edu/stanford/nlp/tagger/maxent/TaggerConfig.java:207
this.setProperty("mode", Mode.DUMP.toString());
// this.setProperty("file", props.getProperty("dump").trim());
props.setProperty("model", props.getProperty("dump").trim());
} else {
this.setProperty("mode", Mode.TAG.toString());
this.setProperty("file", "stdin");
}
//for any mode other than train, we load a classifier, which means we load a config - model always needs to be specified
//on command line/in props file
//Get the path to the model (or the path where you'd like to save the model); this is necessary for training, testing, and tagging
this.setProperty("model", props.getProperty("model", this.getProperty("model", "")).trim());
if ( ! (this.getMode() == Mode.DUMP) && this.getProperty("model").isEmpty()) {
throw new RuntimeException("'model' parameter must be specified");
}
this.setProperty("search", props.getProperty("search", this.getProperty("search")).trim().toLowerCase());
String srch = this.getProperty("search");
if ( ! (srch.equals("cg") || srch.equals("iis") || srch.equals("owlqn") || srch.equals("qn") || srch.equals("owlqn2"))) {
throw new RuntimeException("'search' must be one of 'iis', 'cg', 'qn' or 'owlqn' or 'owlqn2': " + srch);
}
this.setProperty("sigmaSquared", props.getProperty("sigmaSquared", this.getProperty("sigmaSquared")));
this.setProperty(TAG_SEPARATOR_PROPERTY, props.getProperty(TAG_SEPARATOR_PROPERTY, this.getProperty(TAG_SEPARATOR_PROPERTY)));
this.setProperty("iterations", props.getProperty("iterations", this.getProperty("iterations")));
this.setProperty("rareWordThresh", props.getProperty("rareWordThresh", this.getProperty("rareWordThresh")));
this.setProperty("minFeatureThresh", props.getProperty("minFeatureThresh", this.getProperty("minFeatureThresh")));
this.setProperty("curWordMinFeatureThresh", props.getProperty("curWordMinFeatureThresh", this.getProperty("curWordMinFeatureThresh")));
this.setProperty("rareWordMinFeatureThresh", props.getProperty("rareWordMinFeatureThresh", this.getProperty("rareWordMinFeatureThresh")));
this.setProperty("veryCommonWordThresh", props.getProperty("veryCommonWordThresh", this.getProperty("veryCommonWordThresh")));
this.setProperty("occurringTagsOnly", props.getProperty("occurringTagsOnly", this.getProperty("occurringTagsOnly", OCCURRING_TAGS_ONLY)));
this.setProperty("possibleTagsOnly", props.getProperty("possibleTagsOnly", this.getProperty("possibleTagsOnly")));
this.setProperty("lang", props.getProperty("lang", this.getProperty("lang")));
this.setProperty("openClassTags", props.getProperty("openClassTags", this.getProperty("openClassTags")).trim());View on GitHub (pinned to 1b7edd19c4)