public void testMixedTypesInSameIndexField() throws Exception {
Directory dir = newDirectory();
Directory taxoDir = newDirectory();
TaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter(taxoDir);
FacetsConfig config = new FacetsConfig();
RandomIndexWriter writer = new RandomIndexWriter(random(), dir);
Document doc = new Document();
doc.add(new IntAssociationFacetField(14, "a", "x"));
doc.add(new FloatAssociationFacetField(55.0f, "b", "y"));
try {
writer.addDocument(config.build(taxoWriter, doc));
fail("did not hit expected exception");
} catch (IllegalArgumentException exc) {
// expected
}
IOUtils.close(writer, taxoWriter, dir, taxoDir);