Skip to content

Update SDK 3 FTS to further detail facets in results#99

Open
chvck wants to merge 3 commits into
couchbaselabs:masterfrom
chvck:fts
Open

Update SDK 3 FTS to further detail facets in results#99
chvck wants to merge 3 commits into
couchbaselabs:masterfrom
chvck:fts

Conversation

@chvck

@chvck chvck commented Oct 14, 2020

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread rfc/0052-sdk3-full-text-search.md
Comment thread rfc/0052-sdk3-full-text-search.md
Comment thread rfc/0052-sdk3-full-text-search.md Outdated

##### Term Facet Results
```
class TermFacetResult implements SearchFacetResult {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

java calls it TermSearchFacetResult

Comment thread rfc/0052-sdk3-full-text-search.md Outdated
The JSON structure of each **term range** is:

```
TermRange {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

java calls it SearchTermRange

Comment thread rfc/0052-sdk3-full-text-search.md Outdated

##### Date Range Facet Results
```
class DateFacetResult implements SearchFacetResult {

@daschl daschl Oct 27, 2020

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

java is DateRangeSearchFacetResult (and same pattern for the others)

long other();
List<TermFacetResult> terms();
List<NumericRangeFacetResult> numericRanges();
List<DateRangeFacetResult> dateRanges();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the names now also need to be modified

The JSON structure of each **date range** is:

```
DateRange {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SearchDateRange?

The JSON structure of each **numeric range** is:

```
NumericRange {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SearchNumericRange?

The JSON structure of each **term range** is:

```
TermFacet {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SearchTermRange?

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates RFC 0052’s SDK3 Full Text Search specification to more fully describe how facet results are represented in search responses, including JSON shape examples and suggested SDK-side representations.

Changes:

  • Expanded the SearchFacetResult section with detailed JSON examples and proposed in-language model shapes for term/numeric/date facets.
  • Added a revision-history entry for the facet-result expansion and updated the signoff table to reflect revision #8 signoffs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"total": long
"missing": long
"other": long
"terms": [ {TermRange}, ... ] <1>
The section could be represented by a `Map` (or equivalent, eg. associative array).

```
Map<String, SearchFacetResult> facets();
Comment on lines +675 to +679
String name();
String field();
long total();
long missing();
long other();
long other();
}
```
Note the `name` is made part of the `FacetResult`, so that it can be used in isolation.
}
```

Note that the `name()` is deprecated in this implementation, `name` is not required in this implemenatation due to it belonging the `SearchFacetResult` classes themselves.
Comment on lines +688 to +692
String name(); // deprecated
String field();
long total();
long missing();
long other();
Comment on lines +693 to +695
List<TermFacetResult> terms();
List<NumericRangeFacetResult> numericRanges();
List<DateRangeFacetResult> dateRanges();
```
class TermSearchFacetResult implements SearchFacetResult {
//... all from FacetResult, plus:
List<SearchTermRange> terms();
```
class NumericRangeSearchFacetResult implements SearchFacetResult {
//... all from FacetResult, plus:
List<SearchNumericRange> numericRanges();
```
class DateRangeSearchFacetResult implements SearchFacetResult {
//... all from FacetResult, plus:
List<SearchDateRange> dateRanges();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants