discourse_api search broken


(Руслан Корнев) #1

Hi, while testing search feature found that search method in discourse_api doesn’t work. It’s make requests to /search.json?term=x but seems it’s wrong. The corrects ways is /search?search=x or may be /search/query?term=x right?


(Sam Saffron) #2

looks like the api gem is out of date, can you send through a PR change it over to /search/query


(Руслан Корнев) #3

Hmmm, i’ve pushed some changes before, which allowed me to request topics by tags.

By the way i can suggest this changes.

https://github.com/discourse/discourse_api/pull/74


(Erik Chan) #4

No wonder I couldn’t get it to return anything remotely useful :dizzy_face:


(Sam Saffron) #5

@techAPJ can you add to your list?


(Erik Chan) #6

It looks like it has already been changed to /search/query? But its still faulty, always returns {"grouped_search_result"=>nil}


(Arpit Jalan) #7

Saerching via API is working fine for me. Just added this example search script and results are as expected…


(Erik Chan) #8

Finally found the problem on my side, this is what I have to do to make it show something useful

client.search(“discourse”, q={} )


(Arpit Jalan) #9