I'm trying to create a Lucene index to index some custom data.
I can successfully create the index files, and each of my records get a document in the index, but the docuemnts only contain the NodeId and Type from the IndexedNode, but none of the data in the RowData property are being stored, according to the Luke tool.
Following is my code and the config:
Data Service:
public class ProductIndexDataService : ISimpleDataService
{
public IEnumerable<SimpleDataSet> GetAllData(string indexType)
{
var set = new List<SimpleDataSet>();
set.Add(createSet(1, indexType));
set.Add(createSet(2, indexType));
set.Add(createSet(3, indexType));
return set;
}
private SimpleDataSet createSet(int index, string indexType)
{
var simpleDataSet = new SimpleDataSet();
simpleDataSet.NodeDefinition = new IndexedNode();
simpleDataSet.NodeDefinition.NodeId = index;
simpleDataSet.NodeDefinition.Type = "CustomData";
simpleDataSet.RowData = new Dictionary<string, string>();
simpleDataSet.RowData.Add("Name", "Some name " + index);
simpleDataSet.RowData.Add("Description", "Some desc " + index);
return simpleDataSet;
}
}
Are you able to attach debugger and see if it its hitting that code? Do you get an index albeit empty one? One more thing trying setting runAsync to true as i have db indexer that works and thats the only difference i can between mine and yours.
ISimpleDataService not indexing data
I'm trying to create a Lucene index to index some custom data.
I can successfully create the index files, and each of my records get a document in the index, but the docuemnts only contain the NodeId and Type from the IndexedNode, but none of the data in the RowData property are being stored, according to the Luke tool.
Following is my code and the config:
Data Service:
Searcher
Code for rebuilding the index:
I can't figure out what I am missing to get the RowData into my index?
Sidenote. The Umbraco version is 6.2.4
Hi Morten,
Try changing the index configuration to the following....
This is the only major difference I can see in our current 6.2.2 build using ISimpleDataService's and ours are working quite nicely.
Don't forget to rebuild your index after making the configuration change!
Kind regards,
Tim
Morten,
Are you able to attach debugger and see if it its hitting that code? Do you get an index albeit empty one? One more thing trying setting runAsync to true as i have db indexer that works and thats the only difference i can between mine and yours.
Regards
Ismail
Tim, you were right on the money. I was using the wrong config field. Thanks!
is working on a reply...