-
Notifications
You must be signed in to change notification settings - Fork 103
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
FEAT: Introduce integration with Algolia #933
Conversation
Supports querying single index only. Multiple indices query is not implemented. Refer to o19s/splainer-search#144 for the related issue in splainer-search
Use of |
I don't know if it's a good way to solve this. This is the first time I am writing Ruby code. If there are better alternatives to this, happy to incorporate them in the PR. Btw, the JS analysis is failing. I suspect it's a false positive as that's how Angular modules are defined. Am I missing something? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great!
// pass pending settings onward to be saved | ||
$scope.pendingSettings.submit = submit; | ||
}); | ||
|
||
function submit () { | ||
let validateJson = false; | ||
if ( $scope.pendingSettings.searchEngine === 'es' || $scope.pendingSettings.searchEngine === 'os' || $scope.pendingSettings.searchEngine === 'vectara'){ | ||
if ( $scope.pendingSettings.searchEngine === 'es' || $scope.pendingSettings.searchEngine === 'os' || $scope.pendingSettings.searchEngine === 'vectara' || $scope.pendingSettings.searchEngine === 'algolia'){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Someday I wish we had a set of capablities that you could consult to make these choices. This code might look more like:
if $capabilitiesSvc.has(JSON_FORMATTED_QUERIES) {
validateJson = true;
}
The $capabilitiesSvc
would know what your search engine could do. Or maybe it's more like
if ($scope.pendingSettings.searchEngine.hasCapability(JSON_FORMATTED_QUERIES) {
validateJson = true;
}
// 'vectara' does not support doc lookup by ID. | ||
let supportLookupById = true; | ||
if (settings && settings.searchEngine === 'vectara'){ | ||
supportLookupById = false; | ||
} | ||
else if (settings && settings.searchEngine === 'searchapi'){ | ||
supportLookupById = false; | ||
} else if (settings && settings.searchEngine === 'algolia') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two questions here! 1) Can we have Algolia do a query by id? We use that to power the Snapshot compare function... It lets you get up to date info on a document from the search engine. For search engines that do not provide it, like vectara
and searchapi
I am actually looking at dealing with this by just requiring you to store the document fields at snapshot time... But if Algolia did support a lookup by id, that would be nice. I think it would also help in the "misisng documents" screen as well. And then 2) well, this is more a comment, I wish we had the capablities look up for SUPPORT_LOOKUP_BY_ID
concept ;-).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I have updated the PR for splainer-search o19s/splainer-search#145.
I have pushed an update for changing this flag as well.
The js tool will "re evaluate" code that gets changed, so the underlying pattern of the failure was already there, and I think we can ignore that one. |
Thanks @sumitsarkar for your work, I put a thank you in https://github.com/o19s/quepid/wiki/Extending-Quepid-for-Your-Search-Engine |
Description
Introducing Algolia Search Endpoint in Quepid. This would allow users to configure Algolia Endpoint to query a single index.
Multiple indices query is not implemented.
Refer to o19s/splainer-search#144 for the related issue in splainer-search. Once the splainer-search library is released, this PR would be able to add the integration.
Motivation and Context
Closes #932
How Has This Been Tested?
All tests were manually done. I am open to hear from maintainers on what kind of automated tests can be introduced to reduce this overhead.
Screenshots or GIFs (if appropriate):
Types of changes
Checklist: