I am currently playing around with Sitecore indexes - both solr and lucene.
I have made my own custom index and it works fine for lucene, but I cannot get it to work with Solr.
My problem is that the FieldNameTranslator is null for my index whenever I use the Solr configuration.
I am using the Sitecore ContentSearch dlls to get the indexes in the following manner:
this.IndexName = indexName;
this.index = ContentSearchManager.GetIndex(indexName);
var i = ContentSearchManager.GetIndex("sitecore_master_index");
As a test I also tried fetching the sitecore_master_index and that seems to work. I get the following:
I get an index, but whenever I query it by calling GetQueryable, then it fails with the following error:
Exception: System.ArgumentNullException Message: Value cannot be null. Parameter name: fieldNameTranslator Source: Sitecore.ContentSearch.Linq.Solr at Sitecore.ContentSearch.Linq.Solr.SolrIndexParameters..ctor(IIndexValueFormatter valueFormatter, IFieldQueryTranslatorMap
1 fieldQueryTranslators, FieldNameTranslator fieldNameTranslator, IExecutionContext[] executionContexts, IFieldMapReaders fieldMap, Boolean convertQueryDatesToUtc) at Sitecore.ContentSearch.SolrProvider.LinqToSolrIndex
1..ctor(SolrSearchContext context, IExecutionContext[] executionContexts) at Sitecore.ContentSearch.SolrProvider.SolrSearchContext.GetQueryable[TItem](IExecutionContext[] executionContexts)
I am using SolrNet as IOC which, from what I can read in the documentation, should work from 8.2 and upwards. If I use one of the other IOCs then it works just fine.
So my question is really what could go wrong here? And can somebody explain to me what the FieldNameTranslator is and how it is initiated in configuration? (where I suppose it is set)