mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 03:25:23 +08:00
Corrected Search command
--HG-- branch : dev
This commit is contained in:
@@ -15,3 +15,4 @@ glob:profiling
|
|||||||
glob:src/*.ReSharper
|
glob:src/*.ReSharper
|
||||||
glob:*.orig
|
glob:*.orig
|
||||||
glob:*.suo
|
glob:*.suo
|
||||||
|
glob:*.itrace.csdef
|
||||||
|
@@ -83,8 +83,8 @@ namespace Orchard.Indexing.Commands {
|
|||||||
Context.Output.WriteLine("│ {0} │ {1,6} │", "Title" + new string(' ', 60 - "Title".Length), "Score");
|
Context.Output.WriteLine("│ {0} │ {1,6} │", "Title" + new string(' ', 60 - "Title".Length), "Score");
|
||||||
Context.Output.WriteLine("├──────────────────────────────────────────────────────────────┼────────┤");
|
Context.Output.WriteLine("├──────────────────────────────────────────────────────────────┼────────┤");
|
||||||
foreach ( var searchHit in results ) {
|
foreach ( var searchHit in results ) {
|
||||||
var title = searchHit.GetString("title");
|
var title = searchHit.GetString("title") ?? "- no title -";
|
||||||
title = title.Substring(0, Math.Min(60, title.Length)) ?? "- no title -";
|
title = title.Substring(0, Math.Min(60, title.Length));
|
||||||
var score = searchHit.Score;
|
var score = searchHit.Score;
|
||||||
Context.Output.WriteLine("│ {0} │ {1,6} │", title + new string(' ', 60 - title.Length), score);
|
Context.Output.WriteLine("│ {0} │ {1,6} │", title + new string(' ', 60 - title.Length), score);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user