views:

158

answers:

0

I have decorated my entity's partial class as such:

[Document(MetadataType=typeof(CompanyMetaData))]
    public partial class Company{}

And created a meta data class as such:

class CompanyMetaData
{
    [Field(FieldIndex.UnTokenized, FieldStore.Yes, IsKey = true)]
    public object Id { get; set; }
    [Field(FieldIndex.UnTokenized, FieldStore.Yes, IsDefault = true)]
    public object Name { get; set; }
}

Then I initiate my database index

var dbi = new DatabaseIndexSet<CdbSqlDataContext>(indexDir.FullName, db);

Where db is a valid CdbSqlDataContext instance and indexDir is a directory that exists.
Then I run dbi.Write(); and after a few seconds it returns with the following error:

The required column 'CO_ID' does not exist in the results.

I also tried adding the *name="CO_ID"* tag to represent the database name value at the Id field in the metadata class. This didn't help.

--EDIT--
I have gone deeper in the Linq-2-Lucine library and found the line that's throwing.

return _dataContext.ExecuteQuery(tableType, cmd.CommandText);

The tableType is the correct table and the query is

SELECT [t0].[CO_ID] AS [Id], [t0].[LONG_NM] AS [Name]
FROM [dbo].[CO] AS [t0]

When I manually execute this query, it runs just fine... Any suggestions?