-
Notifications
You must be signed in to change notification settings - Fork 557
feat(search-client): use search client #3133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5175d30
feat(search-client): use search client
francoischalifour c0a1c6f
docs(search-client): update doc
francoischalifour a5b90e3
docs(search-client): update README
francoischalifour f40c131
feat(search-client): update stories
francoischalifour 545040e
docs: update getting started
francoischalifour cadf0fa
docs: update examples
francoischalifour ac5d693
test: update function tests
francoischalifour 664a832
docs: replace import with algoliasearch/lite
francoischalifour 65a20b9
docs(guides): use searchClient
francoischalifour cb2fc7a
fix(community): update InstantSearch config for examples
francoischalifour File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -42,7 +42,8 @@ <h3>Dates</h3> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | ||
| <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.20.1/moment.min.js"></script> | ||
| <script src="https://unpkg.com/[email protected]/public/js/Calendar.js"></script> | ||
| <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/instantsearch.min.js"></script> | ||
| <script src="https://cdn.jsdelivr.net/npm/[email protected]"></script> | ||
| <script src="https://cdn.jsdelivr.net/npm/[email protected]"></script> | ||
| <script src="app.js"></script> | ||
| </body> | ||
|
|
||
|
|
||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -55,4 +55,5 @@ | |
| </div> | ||
|
|
||
| <script src="https://cdn.jsdelivr.net/jquery/1.11.3/jquery.min.js" async></script> | ||
| <script src="https://cdn.jsdelivr.net/npm/[email protected]"></script> | ||
| <script src="search.js"></script> | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,10 +1,9 @@ | ||
| 'use strict'; | ||
| /* global instantsearch */ | ||
| /* global instantsearch algoliasearch */ | ||
|
|
||
| var search = instantsearch({ | ||
| appId: 'latency', | ||
| apiKey: '6be0576ff61c053d5f9a3225e2a90f76', | ||
| indexName: 'instant_search', | ||
| searchClient: algoliasearch('latency', '6be0576ff61c053d5f9a3225e2a90f76'), | ||
| routing: true | ||
| }); | ||
|
|
||
|
|
@@ -143,21 +142,6 @@ search.addWidget( | |
| }) | ||
| ); | ||
|
|
||
| search.addWidget( | ||
| instantsearch.widgets.priceRanges({ | ||
| container: '#prices', | ||
| attributeName: 'price', | ||
| cssClasses: { | ||
| list: 'nav nav-list', | ||
| count: 'badge pull-right', | ||
| active: 'active' | ||
| }, | ||
| templates: { | ||
| header: '<div class="facet-title">Prices</div class="facet-title">' | ||
| } | ||
| }) | ||
| ); | ||
|
|
||
| search.addWidget( | ||
| instantsearch.widgets.sortBy({ | ||
| container: '#sort-by', | ||
|
|
@@ -170,17 +154,17 @@ search.addWidget( | |
| }) | ||
| ); | ||
|
|
||
| search.addWidget( | ||
| instantsearch.widgets.clearAll({ | ||
| container: '#clear-all', | ||
| templates: { | ||
| link: '<i class="fa fa-eraser"></i> Clear all filters' | ||
| }, | ||
| cssClasses: { | ||
| root: 'btn btn-block btn-default' | ||
| }, | ||
| autoHideContainer: true | ||
| }) | ||
| ); | ||
| // search.addWidget( | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would need to be replaced by the new ClearRefinements widget. |
||
| // instantsearch.widgets.clearAll({ | ||
| // container: '#clear-all', | ||
| // templates: { | ||
| // link: '<i class="fa fa-eraser"></i> Clear all filters' | ||
| // }, | ||
| // cssClasses: { | ||
| // root: 'btn btn-block btn-default' | ||
| // }, | ||
| // autoHideContainer: true | ||
| // }) | ||
| // ); | ||
|
|
||
| search.start(); | ||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -41,7 +41,8 @@ | |
| </div> | ||
|
|
||
| <!-- js --> | ||
| <script src="https://cdn.jsdelivr.net/npm/[email protected]"></script> | ||
| <script src="https://cdn.jsdelivr.net/npm/[email protected]"></script> | ||
| <script src="https://cdn.jsdelivr.net/npm/[email protected]"></script> | ||
| <script src="app.js"></script> | ||
| </body> | ||
| </html> | ||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -31,4 +31,5 @@ <h5><i class="fa fa-chevron-right"></i> Ratings</h5> | |
| <div id="pagination" class="text-center"></div> | ||
| </article> | ||
| </section> | ||
| <script src="https://cdn.jsdelivr.net/npm/[email protected]"></script> | ||
| <script src="search.js"></script> | ||
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -72,5 +72,5 @@ | |
| <script src="https://cdn.jsdelivr.net/react/15.5.4/react-dom.min.js" async></script> | ||
| <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBawL8VbstJDdU5397SUX7pEt9DslAwWgQ" async></script> | ||
| <script src="https://cdn.jsdelivr.net/instantsearch-googlemaps/1/instantsearch-googlemaps.min.js" async></script> | ||
|
|
||
| <script src="https://cdn.jsdelivr.net/npm/[email protected]"></script> | ||
| <script src="search.js"></script> | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.