Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
111 lines (100 sloc) 3.04 KB
Feature: Facets
Scenario: List All Facets
Given the following indexed records
| name | age |
| John | 23 |
| John | 17 |
| Jack | 17 |
When I query for ""
Then I should have the following facets
| facet | option | count |
| Name | Jack | 1 |
| Name | John | 2 |
| Age | 17 | 2 |
| Age | 23 | 1 |
Scenario: List Matching Facets
Given the following indexed records
| name | age |
| John | 23 |
| John | 17 |
| Jack | 17 |
When I query for "John"
Then I should have the following facets
| facet | option | count |
| Age | 17 | 1 |
| Age | 23 | 1 |
Scenario: List Multiple Facets Applied to One Record
Given the following indexed records
| name |
| John, Jack |
| John |
| Joe, Jack |
When I query for ""
Then I should have the following facets
| facet | option | count |
| Name | Jack | 2 |
| Name | Joe | 1 |
| Name | John | 2 |
Scenario: Ignore Facets That Do Not Narrow Down List
Given the following indexed records
| name |
| John, Jack |
| John |
When I query for ""
Then I should have the following facets
| facet | option | count |
| Name | Jack | 1 |
Scenario: Query for One Facet
Given the following indexed records
| name | age |
| John | 23 |
| Jane | 17 |
| Jack | 17 |
When I query facets "9f33345"
Then I should find records named "Jane, Jack"
Scenario: Query for Two Facets
Given the following indexed records
| name | age |
| John | 23 |
| Jane | 17 |
| Jack | 17 |
When I query facets "9f33345-9a10ff2"
Then I should find records named "Jane"
Scenario: Query for Facets with Keywords
Given the following indexed records
| name | age |
| John | 23 |
| Jane | 17 |
| Jack | 17 |
When I query "Jane" with facets "9f33345"
Then I should find record named "Jane"
Scenario: List Applied Facets
Given the following indexed records
| name | age |
| John | 23 |
| Jane | 17 |
| Jack | 17 |
When I query facets "9f33345-9a10ff2"
Then I should have the following applied facets
| facet | option |
| Age | 17 |
| Name | Jane |
Scenario: Includes applied facets in facet params
Given the following indexed records
| name | age |
| John | 23 |
| Jane | 17 |
| Jack | 17 |
When I query facets "9f33345"
Then I should have the following facets
| facet | option | count | param |
| Name | Jack | 1 | 9f33345-bff6e04 |
| Name | Jane | 1 | 9f33345-9a10ff2 |
Scenario: Ignore non-matching facets
Given the following indexed records
| name | age |
| John | 23 |
| Jane | 17 |
| Jack | 17 |
When I query facets "bad-facet"
Then I should find 0 records
Jump to Line
Something went wrong with that request. Please try again.