次のインデックス定義がある場合、などのクエリContent:(Morel*)
が使用されたときにブーストが適用されますか?
データベースに2つのドキュメントを追加しました。1つはタイプArticle
、もう1つはタイプResponse
です。とが同じTitle
である。Raven Studioのインデックスに対して上記のクエリを実行すると、両方のドキュメントが同じで返されます。Body
Tags
$Temp:Score
AddMap<Article>(docs => from doc in docs
select new
{
Content = new object[]
{
doc.Title,
doc.Body,
doc.Tags
}
}.Boost(5)); // <-- Boost Article documents.
AddMap<Response>(docs => from doc in docs
select new
{
Content = new object[]
{
doc.Title,
doc.Body,
doc.Tags
}
});
Index("Content", FieldIndexing.Analyzed);
次のコードを使用して検索しています
var searchTerms = string.Join(" OR ",
q.Split(new[] { ' ' },
StringSplitOptions.RemoveEmptyEntries)
.Select(x => string.Format("{0}*",x)));
var query = RavenSession.Advanced
.LuceneQuery<IIndexedEntity, AllDocumentByContent>()
.Include(x => x.Author)
.Search("Content", searchTerms);