public virtual void TestDifferentFieldsAndText()
{
Directory indexDir = NewDirectory();
Directory taxoDir = NewDirectory();
// create and open an index writer
var iw = new RandomIndexWriter(Random(), indexDir, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random(), MockTokenizer.WHITESPACE, false)));
// create and open a taxonomy writer
var tw = new DirectoryTaxonomyWriter(taxoDir, OpenMode.CREATE);
FacetsConfig config = Config;
config.SetIndexFieldName("Band", "$bands");
config.SetIndexFieldName("Composer", "$composers");
seedIndex(tw, iw, config);
IndexReader ir = iw.Reader;
tw.Commit();
// prepare index reader and taxonomy.
var tr = new DirectoryTaxonomyReader(taxoDir);
// prepare searcher to search against
IndexSearcher searcher = NewSearcher(ir);
FacetsCollector sfc = PerformSearch(tr, ir, searcher);
IDictionary<string, Facets> facetsMap = new Dictionary<string, Facets>();
facetsMap["Band"] = GetTaxonomyFacetCounts(tr, config, sfc, "$bands");
facetsMap["Composer"] = GetTaxonomyFacetCounts(tr, config, sfc, "$composers");
Facets facets = new MultiFacets(facetsMap, GetTaxonomyFacetCounts(tr, config, sfc));
// Obtain facets results and hand-test them
AssertCorrectResults(facets);
assertOrdinalsExist("$facets", ir);
assertOrdinalsExist("$bands", ir);
assertOrdinalsExist("$composers", ir);
IOUtils.Close(tr, ir, iw, tw, indexDir, taxoDir);
}