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.

ParameterDescription
qthe free-text search query
startintended start offset for paging; currently unused
maxintended 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.

ParameterDescription
qthe free-text search query
startthe offset of the first result to return
maxthe maximum number of results to return
selTermsselected facet terms to filter by, keyed by field name
sortFieldthe field to sort results by
sortdirthe sort direction, "DESC" for descending, otherwise ascending
outputFieldsthe fields to include in each search hit
searchFieldsthe 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.

ParameterDescription
qthe free-text search query
startthe offset of the first result to return
maxthe maximum number of results to return, defaults to 200 if null
usePagingwhether the request should apply paging
selTermsselected facet terms to filter by, keyed by field name
sortFieldthe field to sort results by; "Name" sorts by surname then first name
sortdirthe sort direction, "DESC" for descending, otherwise ascending
outputFieldsthe fields to include in each search hit
searchFieldsthe 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.

ParameterDescription
querythe free-text search query
orgTypesthe organisation types to restrict the search to; if empty, no search is performed
searchPropertiespaging and sort settings to apply to the request; may be null
pagingwhether the request should apply paging
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.