Skip to content

Conversation

@JasonStoltz
Copy link
Member

@JasonStoltz JasonStoltz commented Oct 29, 2018

Note for reviewers: Reviewing the individual commits will provide a cleaner diff, since in the main diff some files are shown as new, rather than moved.

After implementing search on Elastic.co, there were a number of things that I added to the "core" files, that would be good to add here.

The "core" files here are a set of files which act as a "library" which will eventually be abstracted out into the UI Toolkit. The Reference UI should act as the source of truth for that code until then. Since search on Elastic.co essentially used a copy of those files from this project, it would be ideal to commit those changes back to the Reference UI.

Some of this behavior I'm committing back is not actually used in the Reference UI. However, if someone were to use this application as a starting point, it would benefit them to have that additional behavior available for use.

Updates include:

  • Updated version of swiftype-app-search-javascript to the latest
  • Factored out interactions with the swiftype-app-search-javascript client into its own file, called "AppSearchAPIConnector".
  • Support for range filters
  • Updated filter syntax to always use arrays internally, for simplicity
  • Added more inline code documentation, to better serve as a reference
  • Renamed /app-search to /search-lib and created an index.js file to make it feel more like a library rather than additional app code.
  • Added additional actions: clearFilters and setFilter
  • Support for conditional facets and disjunctive facets

There will be slight functional differences in the application:

  • API calls are now cached, so performance will be a bit faster
  • User input will now have an immediate effect on the UI, and the result area will be updated when the API request finishes.
@JasonStoltz JasonStoltz changed the title [WIP] Updated core files Updated core files Oct 29, 2018
Copy link
Contributor

@goodroot goodroot left a comment

Choose a reason for hiding this comment

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

A pair of very minor changes. Logic looks nice. Wonder about fixing OR->AND here, as opposed to in app.

* There's this weird thing where facet values for dates come back as an integer
* from the API, but the API expects them as parameters formatted as date
* strings.
* Facet values for dates come back as Integer from the API. However, the API
Copy link
Contributor

Choose a reason for hiding this comment

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

😄

* Configuration for Facet filters to be used within this application. The
* syntax for Facet configuration follows the API syntax:
* https://swiftype.com/documentation/app-search/api/search/facets. In
* https://swiftype.com/documentation/search-lib/api/search/facets. In
Copy link
Contributor

Choose a reason for hiding this comment

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

This was mistakenly edited during the replace all. :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh geez, good catch 🤦‍♂️

* This is low level configuration which lets you configure
* the options used on the Search API endpoint, ex: `result_fields`.
* https://swiftype.com/documentation/app-search/api/search
* https://swiftype.com/documentation/search-lib/api/search
Copy link
Contributor

Choose a reason for hiding this comment

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

As was this.

* engineName - Engine to query, found in your App Search Dashboard
* hostIdentifier - Credential found in your App Search Dashboard
* searchKey - Credential found in your App Search Dashboard
* endpointBase - (optional) Overrides the base of the Swiftype API endpoint
Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome.

@JasonStoltz JasonStoltz force-pushed the updates-after-elastic-co branch from 0707606 to 50d46b5 Compare October 29, 2018 18:03
@JasonStoltz
Copy link
Member Author

@goodroot Read for re-review

@JasonStoltz
Copy link
Member Author

After implementing search on Elastic.co, there were a number of things that I added to the "core" files, that would be good to add here.

The "core" files here are a set of files which act as a "library" which will eventually be abstracted out into the UI Toolkit. The Reference UI should act as the source of truth for that code until then. Since search on Elastic.co essentially used a copy of those files from this project, it would be ideal to commit those changes back to the Reference UI.

Some of this behavior I'm committing back is not actually used in the Reference UI. However, if someone were to use this application as a starting point, it would benefit them to have that additional behavior available for use.

Updates include:

  • Updated version of swiftype-app-search-javascript to the latest
  • Factored out interactions with the swiftype-app-search-javascript client into its own file, called "AppSearchAPIConnector".
  • Support for range filters
  • Updated filter syntax to always use arrays internally, for simplicity
  • Added more inline code documentation, to better serve as a reference
  • Renamed /app-search to /search-lib and created an index.js file to make it feel more like a library rather than additional app code.
  • Added additional actions: clearFilters and setFilter
  • Support for conditional facets and disjunctive facets

There will be slight functional differences in the application:

  • API calls are now cached, so performance will be a bit faster
  • User input will now have an immediate effect on the UI, and the result area will be updated when the API request finishes.
@JasonStoltz JasonStoltz merged commit ec3a026 into master Oct 29, 2018
@JasonStoltz JasonStoltz deleted the updates-after-elastic-co branch October 29, 2018 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants