I just debugged the search code, and I think the fix seems simple. The problem in my opinion is that the facet values are not using the information contained in DocumentFieldMetadata before storing the document in the index. Especially the indexAsNull property:
In DocumentBuilderIndexedEntity:663
case STRING: {
facetField = new SortedSetDocValuesFacetField( facetMetadata.getFacetName(), value.toString() );
break;
}
Could become:
case STRING: {
if(value == null) {
value = facetMetadata.indexNullAs();
}
facetField = new SortedSetDocValuesFacetField( facetMetadata.getFacetName(), value.toString() );
break;
}
Thanks,
|