2011-03-26 58 views
0

我不知道什么是参数Index.Tokenized和Store实际上是meam,以及该值如何影响索引结果?以下2个属性有什么区别?NHibernate搜索FieldAttribute

class A{ 
    [Field(Index.Tokenized, Store = Store.Yes)] 
    public virtual string P1 { 
    get; 
    set; 
    } 

    [Field] 
    public virtual string P2 { 
    get; 
    set; 
    } 
} 

由于

哈迪

回答

1

Index.Tokenized意味着该字段将被标记化。

Store.Yes表示该字段将存储在索引中。

这里充分的解释:Lucene indexing: Store and indexing modes explained

[Field] 
public virtual string P2 { 
    get; 
    set; 
} 

相当于

[Field(Index.Tokenized, Store = Store.No)] 
public virtual string P2 { 
    get; 
    set; 
}