-
Notifications
You must be signed in to change notification settings - Fork 0
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
better search function #33
Comments
request ability to search within just the plots archive |
Good call. Maybe this can be part of the archive front page redesign: #54 You can already narrow to only searching maps, but a dedicated box for that on the map page would be nice: |
OK, i installed search_autocomplete, the drupal module. It looks great and has namespacing (like you can type "map: blabla" to search only within maps. However it's having some trouble with our version of jQuery (1.7.x): Uncaught TypeError: Object [object Object] has no method 'autocomplete' I tried dropping in the most recent jquery.autocomplete.js but the one in the module is not really a vanilla copy, it's modified for use with Drupal. I think if we can recode the top 16 lines of that file, (/sites/all/modules/search_autocomplete/js/jquery.autocomplete.js), we could pull this off. Drupal.behaviors.search_autocomplete = function(context) { $.each(Drupal.settings.search_autocomplete, function(key, value) { $(Drupal.settings.search_autocomplete[key].selector + ' input:first').filter(':not(.search_autocomplete_processed)').addClass('search_autocomplete_processed').autocomplete( Drupal.settings.search_autocomplete[key].url, { dataType: "json", cacheLength : 20, matchContains: true, minChars: Drupal.settings.search_autocomplete[key].minChars, selectFirst: false, max: Drupal.settings.search_autocomplete[key].max_sug } ).result(function () { $(this).submit(); }); }); }; |
Hmm, i just removed the trailing ".result(function..." and now it is almost working... but the following AJAX request fails. Something wrong with url aliasing? http://publiclaboratory.org/search_autocomplete/3/autocomplete?q=camera&limit=10 |
OK, here is the problem. The correct URL is: http://publiclaboratory.org/search_autocomplete/3/autocomplete/camera&limit=10 not http://publiclaboratory.org/search_autocomplete/3/autocomplete?q=camera&limit=10 Now i need to make sure that form javascript goes to the correct url |
docs say: * If options.queryParamName === false, append query to url instead of using a GET parameter https://raw.github.com/dyve/jquery-autocomplete/master/src/jquery.autocomplete.js |
sweet! it's working but now the returned query is not parseable by search_autocomplete, since probably the new jquery.autocomplete expects a new and different format for search results. Now it's even coming back as json, without erroring. I updated the jquery.autocomplete.js options, and all seem to be OK, it just doesn't actually display the response now:
|
Barnraising vs Barn raising, autocompletion, just better results?
The text was updated successfully, but these errors were encountered: