bearded-avenger / wp-live-search

A live search plugin for WordPress that utilizes REST API + Backbone + Underscore
http://nickhaskins.com/wp-live-search/
GNU General Public License v2.0
101 stars 13 forks source link

Continue here from WP Tavern post :) #5

Closed Marcoevich closed 9 years ago

Marcoevich commented 9 years ago

Hey Nick!

Thanks for your reply on the WP tavern post. let us continue discussion here, since I still believe there may be some kind of bug with it.

I have tested the search string you provided me with in the following manner:

http://test.nl/wp-json/posts?type=bewindvoerders&filter[s]=camiel

It returns the following results:

[{"ID":171,"title":"Camiel Fennis","status":"publish","type":"bewindvoerders","author":{"ID":1,"username":"rick","name":"admin","first_name":"Rick","last_name":"Gommers","nickname":"admin","slug":"rick","URL":"","avatar":"http:\/\/0.gravatar.com\/avatar\/0babac933506ad1047996370e0170b47?s=96","description":"","registered":"2015-02-09T10:30:10+00:00","meta":{"links":{"self":"http:\/\/test.nl\/wp-json\/users\/1","archives":"http:\/\/test.nl\/wp-json\/users\/1\/posts"}}},"content":"","parent":null,"link":"http:\/\/test.nl\/bewindvoerders\/camiel-fennis\/","date":"2015-02-22T15:06:40","modified":"2015-05-12T14:48:07","format":"standard","slug":"camiel-fennis","guid":"http:\/\/test.nl\/?post_type=bewindvoerders&p=171","excerpt":null,"menu_order":0,"comment_status":"closed","ping_status":"closed","sticky":false,"date_tz":"Europe\/Amsterdam","date_gmt":"2015-02-22T14:06:40","modified_tz":"Europe\/Amsterdam","modified_gmt":"2015-05-12T12:48:07","meta":{"links":{"self":"http:\/\/test.nl\/wp-json\/posts\/171","author":"http:\/\/test.nl\/wp-json\/users\/1","collection":"http:\/\/test.nl\/wp-json\/posts","replies":"http:\/\/test.nl\/wp-json\/posts\/171\/comments","version-history":"http:\/\/test.nl\/wp-json\/posts\/171\/revisions"}},"terms":[]}]

Now, from this response I can see that it returns a post from my "bewindvoerders" CPT, called "camiel fennis".

However, the plugin returns this. "camiel" is not even in the results listed:

search results

bearded-avenger commented 9 years ago

good catch! i was appending them in reverse. ;)

bearded-avenger commented 9 years ago

I also just added multiple post type support. It works like this [wp_live_search type="ideas,page" multi="true"]

You can test using the dev branch download if you like: https://github.com/bearded-avenger/wp-live-search/archive/dev.zip

Marcoevich commented 9 years ago

Hehe nice :)

I have tried your dev fix. Works very good! It returns just one result, and exactly the result that I wanted. Great job :)

Cheers!

bearded-avenger commented 9 years ago

Happy to help! I'll have this version out tomorrow on the WordPress plugin repo.