Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save emmanuelbernard/869181 to your computer and use it in GitHub Desktop.
Save emmanuelbernard/869181 to your computer and use it in GitHub Desktop.
void doStuff() {
String userQuery = "...";
SearchService search = new SearchService();
//do the query and display it using your favorite tech
List<Car> results = search.searchCar( userQuery );
displayResultsOnScreen( results );
//build the Facet menu and display it
search.displayFacets();
//user clicks on the third and fifth facet element of color to select them
results = search.selectOrDeselectFacetFilterAndReturnResults( "color", 3 );
displayResultsOnScreen( results );
search.displayFacets(); //refresh facet screen
results = search.selectOrDeselectFacetFilterAndReturnResults( "color", 5 );
displayResultsOnScreen( results );
search.displayFacets(); //refresh facet screen
//user clicks on the third facet element of color to deselect it
results = search.selectOrDeselectFacetFilterAndReturnResults( "color", 3 );
displayResultsOnScreen( results );
search.displayFacets(); //refresh facet screen
}
private void displayResultsOnScreen(List<Car> results) {
//TODO
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment