Skip to content
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

Add autocomplete API #317

Merged
merged 1 commit into from
Aug 22, 2024
Merged

Add autocomplete API #317

merged 1 commit into from
Aug 22, 2024

Conversation

csutter
Copy link
Contributor

@csutter csutter commented Aug 20, 2024

Adds an API endpoint (/autocomplete.json) to return results for an autocomplete component we are currently building. This will return query suggestions for the user as they type, using the Discovery Engine CompletionService API.

  • Add controller/route/request spec for API endpoint and basic ActiveModel data class for result along the lines of existing search API
  • Add DiscoveryEngine::Autocomplete::Complete library to interact with Discovery Engine autocomplete feature
  • Add Rails configuration for (existing) DISCOVERY_ENGINE_DATASTORE environment variable

@csutter csutter force-pushed the autocomp branch 2 times, most recently from b226050 to 386a573 Compare August 20, 2024 14:25
Copy link
Member

@kevindew kevindew left a comment

Choose a reason for hiding this comment

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

Looks good to me, just a few minor things.

app/controllers/autocompletes_controller.rb Outdated Show resolved Hide resolved
app/services/discovery_engine/autocomplete/complete.rb Outdated Show resolved Hide resolved
config/application.rb Show resolved Hide resolved
app/models/completion_result.rb Show resolved Hide resolved
@csutter csutter force-pushed the autocomp branch 2 times, most recently from 4a6f4a4 to c493922 Compare August 21, 2024 12:58
Copy link
Member

@kevindew kevindew left a comment

Choose a reason for hiding this comment

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

Looks good, just the README thing remains - but that needn't block this being merged.

app/models/completion_result.rb Show resolved Hide resolved
config/application.rb Show resolved Hide resolved
Adds an API endpoint (`/autocomplete.json`) to return results for an
autocomplete component we are currently building. This will return query
suggestions for the user as they type, using the Discovery Engine
`CompletionService` API.

- Add controller/route/request spec for API endpoint and basic
  ActiveModel data class for result along the lines of existing search
  API
- Add `DiscoveryEngine::Autocomplete::Complete` library to interact with
  Discovery Engine autocomplete feature
- Add Rails configuration for (existing) `DISCOVERY_ENGINE_DATASTORE`
  environment variable
@csutter csutter merged commit 95537b6 into main Aug 22, 2024
8 checks passed
@csutter csutter deleted the autocomp branch August 22, 2024 08:41
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.

2 participants