Hi,
I have a problem with my index and it could be related to this part
private static Lucene.Net.Documents.Document EntryToDocument(IndexEntry e, bool createSummaryField) { string value = string.Empty; IndexEntryFieldInfo info = null; Lucene.Net.Documents.Document ret = new Lucene.Net.Documents.Document(); string summaryFieldName = IndexEntry.GetSystemFieldName(IndexEntrySystemField.Summary); System.Collections.Generic.Dictionary<string, string> allFields = new System.Collections.Generic.Dictionary<string, string>(e.Fields); if (createSummaryField && !allFields.ContainsKey(summaryFieldName)) allFields.Add(summaryFieldName, e.Summary); foreach (string name in allFields.Keys) { if (!string.IsNullOrEmpty(allFields[name])) { value = allFields[name]; info = e.InitializeField(name, value); if (info != null) { ret.Add(new Lucene.Net.Documents.Field(info.Name, info.Value, (info.Store ? Lucene.Net.Documents.Field.Store.YES : Lucene.Net.Documents.Field.Store.NO), (info.Tokenize ? Lucene.Net.Documents.Field.Index.ANALYZED : Lucene.Net.Documents.Field.Index.NOT_ANALYZED), (info.UseTermVector ? Lucene.Net.Documents.Field.TermVector.YES : Lucene.Net.Documents.Field.TermVector.NO))); } } } return ret; }
Where you only put values in the index if it has a value:
if (!string.IsNullOrEmpty(allFields[name]))
And it gives an index with different columns which doesn't seem to be working.
Any thoughts on this?
Best regards Anders