I have the following attributes applied to my linq to sql class:
[Document(MetadataType = typeof(SomeObjectMetadata))]
public partial class SomeObject
{
}
And this is the metadata code:
public class SomeObjectMetadata
{
[Field(FieldIndex.Tokenized, FieldStore.Yes, IsKey = true)]
private object ProductId { get; set; }
[Field(FieldIndex.Tokenized, FieldStore.Yes, IsDefault = true)]
private object Name { get; set; }
[Field(FieldIndex.Tokenized, FieldStore.Yes)]
private object Description { get; set; }
[Field(FieldIndex.Tokenized, FieldStore.Yes)]
private object Breadcrumb { get; set; }
[Field(FieldIndex.Tokenized, FieldStore.Yes)]
private object Tab1Content { get; set; }
[Field(FieldIndex.Tokenized, FieldStore.Yes)]
private object Tab2Content { get; set; }
[Field(FieldIndex.Tokenized, FieldStore.Yes)]
private object Tab3Content { get; set; }
[Field(FieldIndex.Tokenized, FieldStore.Yes)]
private object Tab4Content { get; set; }
[Field(FieldIndex.Tokenized, FieldStore.Yes)]
private object Tab5Content { get; set; }
[Field(FieldIndex.Tokenized, FieldStore.Yes)]
private object Manufacturer { get; set; }
}
The index store writes just fine, but when I try to search it, I get the error shown in the title. Here's an example search:
var qry = from r in _dbi.Get<SomeObject>()
where r.Description.Like(search)
select r;
Upon enumerating "qry", the Exception "Classes must define at least one field as a default search field" is thrown.