Skip to content

Commit

Permalink
Search API fixes - MaxDocumentsNumber should be a property; facet fie…
Browse files Browse the repository at this point in the history
…lds do not have to have PreviewFunction defined
  • Loading branch information
napernik committed Feb 2, 2017
1 parent 809f86b commit 927042d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Composite/Plugins/Search/Endpoint/ConsoleSearchRpcService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ where selection.Values.Length > 0
Label = StringResourceSystemFacade.ParseString(facetField.Label),
Facets = selection.Values.Select(value => new ConsoleSearchResultFacetValue
{
Label = facetField.Facet.PreviewFunction(value),
Label = (facetField.Facet.PreviewFunction ?? (v => v))(value),
Value = value,
HitCount = 0
}).ToArray()
Expand Down Expand Up @@ -222,7 +222,7 @@ private ConsoleSearchResultFacetField[] GetFacets(SearchResult queryResult, ICol
{
Value = v.Value,
HitCount = v.HitCount,
Label = field.Facet.PreviewFunction(v.Value)
Label = (field.Facet.PreviewFunction ?? (value => value))(v.Value)
}).ToArray()
});
}
Expand Down
2 changes: 1 addition & 1 deletion Composite/Search/SearchQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public void FilterByUser(string userName)
/// <summary>
/// Maximum amount of documents returned.
/// </summary>
public int MaxDocumentsNumber;
public int MaxDocumentsNumber { get; set; }

/// <summary>
/// Facets to be returned.
Expand Down

0 comments on commit 927042d

Please sign in to comment.