How do I call a search of my forum’s posts from wordpress?

Matt777

Member
I want to put a search box on my wordpress blog, a search box that searches the xenforo forum posts.

A typical query looks like this:
HTML:
http://www.mywebsite.com/forum/search/65355/?q=elephant&o=date

I understand that q= is for the search term.

But there's also a strange 5 digit number in the url query. I suppose that’s the ID for that search, but I’m not sure. (P.S. I’m using Enhanced Search)

So if I want to submit a search query from wordpress, what do I use for this number, or do I ignore it or what? (n)
 
Thank you Slavik for the very prompt reply. (y) Just to clarify what you said, the "curl -XGET" is called from PHP, and then I could display the search results within wordpress itself, if I can figure out how to parse the returned results?

My orginal ideas was to use an HTML form submission, like this
Code:
<form action="http://www.mywebsite.com/forum/search/65355/?q=elephant&o=date">
  SEARCH BOX HERE
</form>

... and have it go to the Xenforo search results. I just didn't know what to do with that 65355 number... but your way sounds better, if I'm understanding you correctly?
 
Thank you Slavik for the very prompt reply. (y) Just to clarify what you said, the "curl -XGET" is called from PHP, and then I could display the search results within wordpress itself, if I can figure out how to parse the returned results?

My orginal ideas was to use an HTML form submission, like this
Code:
<form action="http://www.mywebsite.com/forum/search/65355/?q=elephant&o=date">
  SEARCH BOX HERE
</form>

... and have it go to the Xenforo search results. I just didn't know what to do with that 65355 number... but your way sounds better, if I'm understanding you correctly?

The number in XenForo is just how many searches have been done. If you do several searches in a row youll see each time they increase by 1 ;)

Heres some additional documentation which explains it in better detail: http://www.elasticsearch.org/guide/reference/api/search/uri-request.html
 
Top Bottom