-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NCBC-1432: Support Facets in FTS query responses
MOTIVATION ---------- Facets can be added to FTS queries for additional searching behaviour. The submission of facets in a query has already been committed, however, the parsing and processing of the results is missing. This commit adds support for the three available facets: term, numeric range and date range. MODIFICATIONS ------------- - Update ISearchResult.Facets to be a dictionary<string, IFacetResult> - Update SearchDataMapper to parse and process facet results - Add FacetResultType, IFacetResult, DefaultFacetResult, TermFacetResult, Term, NumericRangeFacetResult NumericRange, DateRangeFacetResut and DateRange - Add unit and integration tests to verify behaviour RESULT ------ Facet results are now supported and returned when included in an FTS query. Change-Id: Ie36150bfb51a515ff539e15d0f581962d29e6825 Reviewed-on: http://review.couchbase.org/78488 Tested-by: Build Bot <build@couchbase.com> Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>
- Loading branch information
1 parent
63bc440
commit 7d66ec0
Showing
19 changed files
with
1,958 additions
and
1,518 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2,939 changes: 1,483 additions & 1,456 deletions
2,939
Src/Couchbase.NetStandard/Couchbase.NetStandard.csproj
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
|
||
namespace Couchbase.Search | ||
{ | ||
public class DateRange | ||
{ | ||
/// <summary> | ||
/// Gets or sets the name. | ||
/// </summary> | ||
/// <value> | ||
/// The name. | ||
/// </value> | ||
public string Name { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the start date. | ||
/// </summary> | ||
/// <value> | ||
/// The start. | ||
/// </value> | ||
public DateTime Start { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the end date. | ||
/// </summary> | ||
/// <value> | ||
/// The end. | ||
/// </value> | ||
public DateTime End { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the count. | ||
/// </summary> | ||
/// <value> | ||
/// The count. | ||
/// </value> | ||
public long Count { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace Couchbase.Search | ||
{ | ||
/// <summary> | ||
/// The result for a <see cref="DateRangeFacet"/>. | ||
/// </summary> | ||
public class DateRangeFacetResult : DefaultFacetResult | ||
{ | ||
public DateRangeFacetResult() | ||
{ | ||
DateRanges = new List<DateRange>(); | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the date ranges. | ||
/// </summary> | ||
/// <value> | ||
/// The date ranges. | ||
/// </value> | ||
public IReadOnlyCollection<DateRange> DateRanges { get; set; } | ||
|
||
/// <summary> | ||
/// Gets the type of the facet result. | ||
/// </summary> | ||
/// <value> | ||
/// The type of the facet result. | ||
/// </value> | ||
public override FacetResultType FacetResultType { get { return FacetResultType.DateRange; } } | ||
} | ||
} |
Oops, something went wrong.