discourse_api search broken

AI-generated summary

The discussion is about a broken search feature in the discourse_api. oganer discovered that the API makes incorrect requests to /search.json?term=x instead of /search?search=x or /search/query?term=x. sam suggested updating the API gem, which oganer has already worked on and submitted a pull request for the changes. However, erik_chan and erik_chan are still experiencing issues with the search feature, including it returning {"grouped_search_result"=>nil}. techAPJ reported that searching via API is working fine for them, but erik_chan eventually found the solution to their problem, which involves using client.search("discourse", q={}).

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?

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

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

https://meta.discourse.org/t/the-official-discourse-tags-plugin-discourse-tagging/26482/29?u=oganer

By the way i can suggest this changes.

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

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

@techAPJ can you add to your list?

3개의 좋아요

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

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

3개의 좋아요

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

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

3개의 좋아요