0
如何查詢添加爲IndexEmbedded的數據?
我有一個實體類如何查詢索引爲IndexEmbedded的數據(全文在nhibernate.search中)
[Indexed]
public class Something
{
[Field(Index.Tokenized, Store = Store.Yes)]
public virtual string Description { get; set; }
[IndexedEmbedded]
public virtual Category Category { get; set; }
[IndexedEmbedded]
public virtual Location Location { get; set; }
}
位置作爲
[Indexed]
public class Location
{
/// </summary>
[Field(Index.Tokenized, Store = Store.Yes)]
public virtual string Address
{
}
被添加數據(無論是正常的性能和IndexEmbedded)的指數,我可以將它們用盧克看到。
但是,當我使用全文查詢時,我只獲得有效結果的正常屬性,而不是索引嵌入
例如, 「取樣說明」 => 1分的結果,「帕洛阿爾託」 => 0的結果(兩者都是在指數) 這是我的查詢
using (IFullTextSession s = Search.CreateFullTextSession(NHibernateSession.GetSession())) {
MultiFieldQuerParser qp = new MultiFieldQueryParser(new[] {
「Description」,「Title」,」Name」
}, new StandardAnalyzer());
IQuery NHQuery = s.CreateFullTextQuery(qp.Parse(query), typeof(Something));
result = NHQuery.List();
我做得不對或缺少什麼?