-
Notifications
You must be signed in to change notification settings - Fork 45
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
Documentation: Autocomplete / matcher from the browser with Opensearch #89
Comments
Got it working! Do you want a pull request? Small change, or actually addition, in norch.js: The old matcher is like this: this.app.get('/matcher', function(req, res) {
that.si.match(req.query['beginsWith'], function(err, matches) {
res.send(matches);
});
}); The Opensearch suggestions like this (addition): this.app.get('/opensearchsuggests', function(req, res) {
that.si.match(req.query['beginsWith'], function(err, matches) {
res.send([req.query.beginsWith, matches]);
});
}); |
@eklem did you ever make that PR, or have any code that is PRable? :) |
Haven't made it. It's slightly hackish, but I think it's a good first step to add it, and then make it better. I'll do a PR, and you can decide to use it or not. |
OK! :) |
Not getting it to work in Mozilla anymore, so have to investigate a little. |
Ahh- the matcher API has changed ever-so-slightly, a call to the matcher now looks like this: There are also a few extra options- see the search-index docs for more info |
I'm still on an old version, so that shouldn't matter. It stopped working on Mozilla for Android, but desktop is fine. |
But, I'll leave the Android version for now and try adding the stuff needed. |
This is a great usecase for creating a query-result pipeline |
Another query-pipeline case is #124 |
So, gotten Opensearch.xml to work with the browser search box over at life-index, but need a little more to get the autocomplete to work fully.
Today the respons JSON is an array of suggested search words.
From the Opensearch XML documentation for suggestions it seems I need to alter the JSON a bit. I need the existing list
to look like
Where the first array consists of the query or beginsWith and then the array of suggestions. My question is if you have an idea on how easy it would be to make this a part of the existing Norch without breaking anything?
Before you do anything, I can test with some dummy-JSON to be sure this is actually working for the browser.
The text was updated successfully, but these errors were encountered: