1

次のインデックス定義がある場合、などのクエリContent:(Morel*)が使用されたときにブーストが適用されますか?

データベースに2つのドキュメントを追加しました。1つはタイプArticle、もう1つはタイプResponseです。とが同じTitleである。Raven Studioのインデックスに対して上記のクエリを実行すると、両方のドキュメントが同じで返されます。BodyTags$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);
4

1 に答える 1

1

はい、クエリを作成すると適用されます。

于 2013-01-16T21:16:36.537 に答える