hereswhatidid / search-autocomplete Goto Github PK
View Code? Open in Web Editor NEWWordPress Search Autocomplete
WordPress Search Autocomplete
I started getting an Error 500 on the autocompleteCallback AJAX request after updating to Relevanssi 3.5.9.1
I am using version 2.1.16 of SearchAutocomplete
The portion of searchautocomplete.php that passes the query to Relevanssi (line 129) does not appear to pass a WP_Query object to the relevanssi_do_query() as noted in the Relevanssi documentation: https://www.relevanssi.com/knowledge-base/relevanssi_do_query/
I added the following at line 130 of searchautocomplete.php and the issue appears to be solved:
$query = new WP_Query();
If a site has multiple instances of a search field, autocomplete will not work. Here's a simple fix. Change search-autocomplete.js, see:
https://github.com/hereswhatidid/search-autocomplete/blob/master/js/search-autocomplete.js
Change line 20:
$(options.fieldName).val()
to
term: this.term
I'm using autocomplete with Relevanssi and it's working great. However, we have a bit of a special case where we need to modify the query to filter out items. Would it be possible to add a filter to enable modifying the query regardless of whether relevanssi_do_query
or get_posts
is used?
I'm trying to apply a top offset the results by about 10px so it's not butting up right against the input. Just changing the CSS has not solved the problem and I cannot get any javascript tricks to work out either. Any help on how to get this figured out would be super helpful. Thanks.
Hotlinking occurs regardless of the settings page properties.
For an overview and easier handling a link to the recruitment page on the plugin overview page would be good.
Hi,
great plugin it helps alot. But im missing 2 filters by results.
I've made myself, but maybe someone else would need them too, and i wouldnt need to think about it on updates :)
// wp-content\plugins\search-autocomplete\searchautocomplete.php:165
$resultItem = array(
'title' => $linkTitle,
'url' => $linkURL,
);
$resultsPosts[] = apply_filters( 'search_autocomplete_modify_post_result', $resultItem, $post );
// wp-content\plugins\search-autocomplete\searchautocomplete.php:197
$resultItem = array(
'title' => $linkTitle,
'url' => $linkURL,
);
$resultsTerms[] = apply_filters( 'search_autocomplete_modify_taxonomie_result', $resultItem, $post );
Just installed your plugin on a local install and it works pretty awesome.
However, I have WPML installed as the site is in 5 languages, so I would like my search suggestions to turn up in a singular language only.
The Relevanssi plugin (through which I came to your plugin) actually has something builtin for singular language results, perhaps you can copy that over?
(also posted this as an issue in the WP.org forums)
Awesome job guys, but it seems little slow when trying to access database with every query. Would there be a better way to optimize it like just search through a predefined list read from an in memory array.
An tips how can i achieve this ?
Hi, I can't find a solution to make the search only on the title and not on the post_content, do you know how I could do that?
Thanks
Is there a way to include the post excerpt, or a portion of the excerpt in the autocomlete results?
When the autocomplete list is displayed (or write char when list is display), the console displays an error (in search-autocomplete.min.js file):
Uncaught TypeError: Cannot read property 'menu' of undefined
I checked for taxonomy (only) and marked only the one that I want for search.
If I search by any word, the autocomplete box shows several words belonging to the taxonomies, but it's not matching any criteria neither filtering by the keyword entered.
I type any word in search, existing in the taxonomies or not, and it shows all of the taxonomy names and some other words I'm not sure why they show.
Also I think that maybe it's somehow considering the not empty taxonomies, like if with hide_empty=1, because I have lot more taxonomies that do not show in the list, which is okey. But if it does not match the criteria keyword, it's not good yet for me.
Can you help with this?
thanks
Enter some whitespaces (more then minLength) - as result all posts are fetched. This is bad behaviour, we must trim our input, and call ajax query only if minLength is reached with character, not with whitespace.
Hi
I can't make the taxonomies work so I hack searchautocomplete.php like this, maybe it may help
Best
henri
Afternoon,
Great plugin and it's been working well for the site we have it implemented on. A question that has come up from the client and I figured coming to the source might produce the best answer.
Our site uses Search-Autocomplete to show search results as the user types in a field, but we also have a search button that takes them to a Search Results page. We're seeing 2 different sets of results between the Search-Autocomplete flyout and the results on the WP Search Results page. There is some overlap, but not all the same results and definitely in a different order.
Is there a way to sync these up?
Thanks,
Brian
I've updated to the new version of wordpress 4.1. It uses jquery ui autocomplete version 1.11.2, and it breaks the drop down.
I have been able to add <input type="hidden" name="post_type" value="news" />
and it works if you search and click submit. However, the auto suggest still provides all post types. I've noticed that even if I could add post_type=news in the GET request where the search autocomplete goes when keyup events file. For example, I tried 'curl -v 'http://localhost/wp-admin/admin-ajax.php?action=autocompleteCallback&term=something&post_type=news'
but I get all posts, regardless of their post type.
If there is a way to do this without you having to change the code (perhaps I'm missing some very simple function that I need to add), I'd be glad to try it, but I wanted to record this as an issue in case it hasn't been addressed in the code base.
It would be really nice if there were an option to return a "No results found" message if the search didn't find anything. The message could be displayed as one of the <li>
items inside the autocomplete box with possibility to edit the message from within the admin.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.