hardywang
hardywang

Reputation: 5162

NHibernate Search FieldAttribute

I am not sure what are the parameters Index.Tokenized and Store actually meam, and how the value affect the index result? What is the difference between 2 properties below?

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

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

Thanks

Hardy

Upvotes: 0

Views: 141

Answers (1)

mathieu
mathieu

Reputation: 31192

Index.Tokenized means that the field will be tokenized.

Store.Yes means that the field will be stored in index.

Full explanation here : Lucene indexing: Store and indexing modes explained

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

is equivalent to

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

Upvotes: 1

Related Questions