this is work in progress
Using search
sipXconfig UI (starting in 3.1) has ability to easily locate various configured items (users, phones, groups, conferences etc.)
thanks to Lucene based indexing you can pretty much look for everything
...
Tip If you want to locate an item quicky use the Description field of an item to enter something that you'll later search for.
Search-able items
The following items are currently indexed (and thus search-able) by sipXconfig:
- users and users' groups
- phones and phones' group
- hunt groups
- gateways
- dial plan rules
- call park orbits
- auto attendants
Query syntax
In most cases you can search just by entering a word or a number, but sipXconfig exposes rich Lucene search syntax:
...
In order to use global search enter your query in the Search box, which is located to the right of navigation bar press Enter. You will be presented with the search result page that displays the number of items found, name and a short description of each item. Usually the results may comprise multiple types of items. You may see users, phones and hunt groups.
Adding search support
5 minutes minimum
In order to be search-able your beans need to inherit from BeanWithId class (if you cannot do it there is a way around it but it requires a lot of work) and it has to have an Edit page so that user has something to click on once your bean is found.
...
You do not really have to read or understand the following sections, but it may help if you have problems.
sipXconfig search implementation
Lucene is a general purpose library for indexing and searching. This description presents one of the many possible ways it can be used to index database accessed through Hibernate. The implementation was inspired by this code poet blog entry.
sipXconfig is using Lucene to implement its search functionality. Lucene is based on the concept of search-able index. In sipXconfig index is updated every time when items are added to database and every time it is modified. Every indexed entity (user, phone, hunt group etc.) is a "document" in the Lucene understanding of this word. The document is identified by its Java class and hibernate/database identifier: which allows us to load the object from the database when Lucene returns search results.
Maintaining index
Lucene index files are kept in {prefix}/var/sipxdata/tmp/index directory. If you delete this directory index will be automatically recreated. You should use:
...
The names of the fields are the property names, and not the SQL database column names.
Displaying search results
The searching is an easy part. SearchManager implements several functions that you can call to retrieve search results. Most of the functions take a jakarta collections compatible Transformer parameter. If transformer is provided, it'll be used to convert each search result (hit). Typically you would use transformer to load the objects from the database, however searching is noticeably faster if you do not have to load the beans.
...