Thomas Mueller created OAK-12547:
------------------------------------
Summary: Trying to read multi-valued binaries as a string
Key: OAK-12547
URL: https://issues.apache.org/jira/browse/OAK-12547
Project: Jackrabbit Oak
Issue Type: Improvement
Reporter: Thomas Mueller
The class
oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/spi/editor/FulltextDocumentMaker.java
currently uses if (Type.BINARY == property.getType()) ... to avoid reading
binaries as strings. However, what is missing is the case where there is a
multi-valued property. This can fail with something like this:
{noformat}
java.lang.IllegalStateException: Attempting to read binary property 'test' as
STRING.
This can fail if the binary is stored externally. Binary properties should be
checked before getValue() is called.
at
org.apache.jackrabbit.oak.segment.SegmentPropertyState.getValue(SegmentPropertyState.java:223)
at
org.apache.jackrabbit.oak.segment.SegmentPropertyState.getValue(SegmentPropertyState.java:158)
at
org.apache.jackrabbit.oak.plugins.index.search.spi.editor.FulltextDocumentMaker.indexAggregatedNode(FulltextDocumentMaker.java:706)
at
org.apache.jackrabbit.oak.plugins.index.search.spi.editor.FulltextDocumentMaker$ResultCollector.onResult(FulltextDocumentMaker.java:633)
at
org.apache.jackrabbit.oak.plugins.index.search.Aggregate$NodeInclude.collectResults(Aggregate.java:308)
at
org.apache.jackrabbit.oak.plugins.index.search.Aggregate$Matcher.collectResults(Aggregate.java:620)
at
org.apache.jackrabbit.oak.plugins.index.search.Aggregate.matchChildren(Aggregate.java:169)
at
org.apache.jackrabbit.oak.plugins.index.search.Aggregate.collectAggregatesForDirectMatchers(Aggregate.java:152)
at
org.apache.jackrabbit.oak.plugins.index.search.Aggregate.collectAggregates(Aggregate.java:133)
at
org.apache.jackrabbit.oak.plugins.index.search.Aggregate.collectAggregates(Aggregate.java:85)
at
org.apache.jackrabbit.oak.plugins.index.search.spi.editor.FulltextDocumentMaker.indexAggregates(FulltextDocumentMaker.java:612)
{noformat}
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)