mirror of
https://github.com/apache/lucene.git
synced 2025-02-11 20:45:27 +00:00
SOLR-9005: Add guard condition to the example js
This commit is contained in:
parent
f0447c456a
commit
dc485a0eb6
@ -68,6 +68,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…
x
Reference in New Issue
Block a user