mirror of https://github.com/apache/lucene.git
SOLR-9005: Add guard condition to the example js
This commit is contained in:
parent
94c796968a
commit
9148362617
|
@ -122,6 +122,8 @@ Bug Fixes
|
|||
|
||||
* SOLR-9624: In Admin UI, do not attempt to highlight CSV output (Alexandre Rafalovitch)
|
||||
|
||||
* SOLR-9005: In files example, add a guard condition to javascript URP script (Alexandre Rafalovitch)
|
||||
|
||||
Other Changes
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -72,13 +72,18 @@ function processAdd(cmd) {
|
|||
doc.setField("content_type_subtype_s", ct_subtype);
|
||||
}
|
||||
|
||||
var content = doc.getFieldValue("content");
|
||||
if (!content) {
|
||||
return; //No content found, so we are done here
|
||||
}
|
||||
|
||||
var analyzer =
|
||||
req.getCore().getLatestSchema()
|
||||
.getFieldTypeByName("text_email_url")
|
||||
.getIndexAnalyzer();
|
||||
|
||||
var token_stream =
|
||||
analyzer.tokenStream("content", doc.getFieldValue("content"));
|
||||
analyzer.tokenStream("content", content);
|
||||
var term_att = token_stream.getAttribute(get_class("org.apache.lucene.analysis.tokenattributes.CharTermAttribute"));
|
||||
var type_att = token_stream.getAttribute(get_class("org.apache.lucene.analysis.tokenattributes.TypeAttribute"));
|
||||
token_stream.reset();
|
||||
|
|
Loading…
Reference in New Issue