「テキスト」以外のフィールドではハイライト表示できません。これを見て:
/**
* Returns a collection of the names of all stored fields which can be
* highlighted the index reader knows about.
*/
public Collection<String> getStoredHighlightFieldNames() {
if (storedHighlightFieldNames == null) {
storedHighlightFieldNames = new LinkedList<String>();
for (String fieldName : fieldNames) {
try {
SchemaField field = schema.getField(fieldName);
特にここに:
if (field.stored() &&
((field.getType() instanceof org.apache.solr.schema.TextField) ||
(field.getType() instanceof org.apache.solr.schema.StrField))) {
ここ
storedHighlightFieldNames.add(fieldName);
}
} catch (RuntimeException e) { // getField() throws a SolrException, but it arrives as a RuntimeException
log.warn("Field \"" + fieldName + "\" found in index, but not defined in schema.");
}
}
}
return storedHighlightFieldNames;
}
出典
2011-07-14 08:07:36
fyr
ありがとうございます!しかし、恐れがあります:( – Moogie
どのような非テキストフィールドがドキュメントにクエリを満たすのかを特定する方法はありますか? – Moogie
おそらく、非テキストフィールドがクエリの一部と一致していることを意味します。 – fyr