ejabberd BOSH search brings nothing

[亡魂溺海] 提交于 2019-12-02 12:49:50

Simple type of search (one without <x xmlns="jabber:x:data" type="submit">) somehow returned error.

For extended search, it turned out, I was not sending

<field type="hidden" var="FORM_TYPE"><value>jabber:iq:search</value></field>

clause. That omission was working fine against Openfire, ejabberd requires it.

Still, Openfire Search plugin provides convenience and efficiency which I didn't find in ejabberd: it allows a chat client to display one search box and then to search for the value user typed in several fields (search OR functionality). On a client side, you need to send search request like

<body rid='273260412' xmlns='http://jabber.org/protocol/httpbind' sid='961w8ipmo2'>
  <iq type='set' id='search2' to='yourSearchDomain.com' xmlns='jabber:client'>
    <query xmlns='jabber:iq:search'>
      <x xmlns='jabber:x:data' type='submit'>
        <field var='search'><value>your_search_term</value></field>
        <field var='Username'><value>1</value></field>
        <field var='Name'><value>1</value></field>
        <field var='Email'><value>1</value></field>
      </x>
    </query>
  </iq>
</body>

Openfire Search plugin would interpret this request as a command to perform three search requests: to find users with Username which matches your_search_term, then to find users with Name matching, and with Email matching. All three search results would be combined using logical OR.
Client only needs to send one Http search request to Openfire to search for your_search_term in three fields. With ejabberd, client would need to send three Http requests...

It would be nice to implement similar functionality in ejabberd module...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!