Builds and runs the Elasticsearch queries for lead-related profile, organisation and combined (omni) search. This is the earlier (V1) implementation, superseded by LeadManSearchHelperV2. It is still constructed and exposed via LeadManager's getSearchV1 accessor, but that accessor has no remaining callers in the platform, so it exists only for backwards compatibility. Every query it builds restricts results to leads and organisations the current user can see, based on their reporting hierarchy, sales team membership or direct lead assignment.
Methods
omniSearch(String q, Integer start, Integer max)
Returns: KSearchResponse
Searches profiles and organisations together for a lead management omni-search box, matching on either a profile or an organisation. The organisation search is scoped to the lead org type configured for the tenant, if any. Note that the start and max parameters are accepted but are not currently applied to the underlying request, so they have no effect on the results returned.
| Parameter | Description |
|---|---|
q | the free-text search query |
start | intended start offset for paging; currently unused |
max | intended maximum number of results; currently unused |
profileSearch(String q, Integer start, Integer max, Map<String,List<String>> selTerms, String sortField, String sortdir, List<String> outputFields, List<String> searchFields)
Returns: KSearchResponse
Searches lead-related profiles, delegating to the paged overload with paging disabled.
| Parameter | Description |
|---|---|
q | the free-text search query |
start | the offset of the first result to return |
max | the maximum number of results to return |
selTerms | selected facet terms to filter by, keyed by field name |
sortField | the field to sort results by |
sortdir | the sort direction, "DESC" for descending, otherwise ascending |
outputFields | the fields to include in each search hit |
searchFields | the fields to match the query text against; if null, a default set is used |
profileSearch(String q, Integer start, Integer max, boolean usePaging, Map<String,List<String>> selTerms, String sortField, String sortdir, List<String> outputFields, List<String> searchFields)
Returns: KSearchResponse
Searches lead-related profiles, matching the query text against name, email and custom indexed fields, and restricting results to profiles in the lead management group that the current user has visibility over. Also aggregates the most recent SMS and email item per profile and the number of distinct organisations and groups represented in the results.
| Parameter | Description |
|---|---|
q | the free-text search query |
start | the offset of the first result to return |
max | the maximum number of results to return, defaults to 200 if null |
usePaging | whether the request should apply paging |
selTerms | selected facet terms to filter by, keyed by field name |
sortField | the field to sort results by; "Name" sorts by surname then first name |
sortdir | the sort direction, "DESC" for descending, otherwise ascending |
outputFields | the fields to include in each search hit |
searchFields | the fields to match the query text against; if null, a default set is used |
orgSearch(String query, List<OrgType> orgTypes, SearchProperties searchProperties, Boolean paging)
Returns: KSearchResponse
Searches organisations of the given types, matching the query text against title, address and identifier fields and restricting results to organisations the current user can see. Returns null if no organisation types are supplied.
| Parameter | Description |
|---|---|
query | the free-text search query |
orgTypes | the organisation types to restrict the search to; if empty, no search is performed |
searchProperties | paging and sort settings to apply to the request; may be null |
paging | whether the request should apply paging |