-
Notifications
You must be signed in to change notification settings - Fork 591
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
Introduce Search API #648
Introduce Search API #648
Conversation
4d27741
to
0c6feb4
Compare
deleteAllDocuments(done); | ||
}); | ||
|
||
it('should create a document in a new index', function(done) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Also, I added document building functionality and updated the first post here with some examples. |
37cbe32
to
3ba6411
Compare
The todo list is a-ticking away. Now would be a good time to catch any mis-steps (see the docs). Next to tackle are the tests. |
9646049
to
1aa9f1e
Compare
This is ready for review (from who, I don't know 😄). Todos completed. |
I will
|
|
||
/*! Developer Documentation | ||
* | ||
* streamRouter is used to extend `nextQuery`+callback methods with stream |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
I run
|
I thought that might just be me. Can you advise how to debug that? |
I think it's because we pass the external Easiest way to fix is overwrite |
}); | ||
|
||
describe('search', function() { | ||
var query = 'ryan'; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
1aa9f1e
to
6d6c0d6
Compare
@@ -78,6 +78,7 @@ describe('documentation', function() { | |||
gcloud: gcloud, | |||
require: require, | |||
process: process, | |||
console: console, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
6d6c0d6
to
51efe0e
Compare
@@ -74,10 +74,16 @@ describe('documentation', function() { | |||
].join('\n')); | |||
} | |||
|
|||
var mockConsole = Object.keys(console).reduce(function(console, method) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Looks GREAT to me! |
0e7e32c
to
fc3cf78
Compare
* | ||
* var document = search.index('records').document('stephen'); | ||
* | ||
* //- |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
fc3cf78
to
27fbcf9
Compare
Wee! I just added this in to handle pre-mature closing of a stream: stephenplusplus@abca6f1 Basically to handle something like this: index.getDocuments().on('data', function(document) {
if (document.id === 'the-one-i-want') {
this.end();
}
}); Before the change, we would have had no idea |
Merge-time! |
Source-Link: googleapis/synthtool@d229a12 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:74ab2b3c71ef27e6d8b69b1d0a0c9d31447777b79ac3cd4be82c265b45f37e5e
Source-Link: googleapis/synthtool@d229a12 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:74ab2b3c71ef27e6d8b69b1d0a0c9d31447777b79ac3cd4be82c265b45f37e5e
…ncy versions (#648) This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/9be7b892-4bc6-4dcb-8dc8-41f27e5fc193/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: googleapis/synthtool@fdd03c1
…ncy versions (#648) This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/9be7b892-4bc6-4dcb-8dc8-41f27e5fc193/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: googleapis/synthtool@fdd03c1
Fixes #632
Docs: https://stephenplusplus.github.io/gcloud-node/#/docs/master/search
To dos:
Search#getIndexes()
Index#getDocuments()
Index#search()
API can't-do's:
Not perfected yet:
Document JSON (when creating a document, we may be able to ease the field specification process)Queries (we can probably have an object builder rather than just accepting a string)Examples:
Create an index / Create a document from scratch
Create a document from an existing JSON object / file
Get search results with a callback
Stream search results