powered by Jive Software

Is Openfire supports searching of users?

Hello All,

I want to provide user search facilty in my chat server so that other user can search user based on some their interest, locations etc. Is there is some way to implement such feature… and can we search user by name or id ?:expressionless: .

waiting 4 reply…

Thanks in advance


did you ever take a look at the search plugin? One needs to extend it to be able to search for interests etc. but searching for users is possible.


Hello IT2000,

Thanks for the help…

I see this plugin and I also found getSearchFields() method in UserProvider interface which can be used for defining fields on which we can do search and findUsers method for searching users.

we can implement these methods according to our need in our UserProvider implimentation.


I faced the same problem,

I want to extend OFUser tables fields for gender,phone number, and other custom profile, and want to search users based on these new fields,

could any body please help me on this issue.

Also using UserSearchManager I could only search users by Username, and search user based on Name causes Uncaught exception: Field not found for the specified variable name.

Any help would be appreciated.

Best Regards

Should the users use their xmpp clients (http://xmpp.org/extensions/xep-0055.html) or do you plan a web based search? How should the new fields be filled?

Extending the ofuser table will break compatibility. Better create a new table and use ofuser/username as the foreign (primary) key.

Thanks for you reply,

actually I want to store more information from xmpp clients, as I mentioned above, and want these parameters be searchable to find specific user, something like what is provided in online social nets,

As I know, VCard is designed to hold extra info, but using this structure causes huge load for every search, also I see VCard2OFUser plugin but this plugin also has the same problem of resource usage, I faced two solutions listed bellow:

1-As you said, create another table to hold VCard fields (eg. gender,education,city, etc) and write an openfire plugin to update this table on every vcard update per user. Also write another plugin to provide usersearch based on OpenFire native search plugin, that enables Smack clients to query server for results.

2-Migrate to LDAP solution, and write a web-based form to update LDAP profile items from the clients (something like webview in android client), and use current search plugin to search users based on custom fields.

which one do you advise? and if you have better soltio please explain.

I’m really new to openfire plugin development, and find resources bellow:


https://igniterealtime.org/builds/openfire/docs/latest/documentation/plugin-dev- guide.html

are these enogh to make above solutions

thanks very much for your king help.

Best Regards

Using vCard info should be fine.

You could still export the vCard info into LDAP but I wouldn’t do this so early.

Also a web-chat and web-UI to edit the profile may be nice to have.

To start develop plugins: Take a look at the existing ones (eg broadcast) and clone them. I have no idea whether the docs are still up to date.

Hi LG,

Thanks very much for your kind reply,

I reach a final solution, please read it and confirm if its possible,extendible and simple also,

These are the steps I’m going to take:

*in the server side:

1-create a table OFUserProfile to hold custom user profile data (UID,Name,PhoneNumber,City,Gender,etc)

2-Write an Openfire plugin to move all VCard Data to theire related field in newlly creaded table (OFUserProfile)

2-Write an Openfire plugin to Update or Insert profile data whenever a User VCard in OFUser table updated/inserted.

3-Write a Customized Version of Openfire search plugin to search users based on any specified field of OFUserProfile Table and return user JID or list of user JID s.

**in the Client side,

1- Use the native vcard update methods of smack to update user profile info

2- User the native search plugin to search users based on specific profile field

Is is OK, and easy to implement?

Please Help which type of plugins is suited for each of the above plugins to clone for further development.

Thanks again

Best Regards

I’d start with ‘2- User the native search plugin to search users based on specific profile field’ and ‘3-Write a Customized Version of Openfire search plugin to search users based on any specified field of OFUserProfile Table and return user JID or list of user JID s’ to make sure that searching for other vCard fields work for the client. I’m not sure whether this is implemented in Spark. This seems to be the critical part.

Creating and updating the new table is easy and can be done later. The vCard2ofUser plugin should be a good starting point and easy to extend.