You are here:
Hybrid Search Query Expressions
Enhance your hybrid search queries with pre-filtering fields and join expressions to access fields.
Filter Expressions in Hybrid Search
Case Sensitivity on Pre-filtering Fields
Names of pre-filtering fields are case insensitive. For example, if the name of a field is
My_Column_c , a filter expression with my_column_c correctly
references that field. However, case matters for values used within filters. If the field has a
value SomeValue, the filter expression
My_Column_c='somevalue' or My_Column_c='SOMEVALUE' results in
a no-match—only the expression My_Column_c='SomeValue' matches that record.
Default Pre-filtering Fields
The field DataSource__c from the chunk data model object (CDMO) is a default
pre-filtering field. It is always available in pre-filtering queries.
Pre-filtering Values for Objects in 1:N Relationships
When creating a search index, you can index only one pre-filtering value.
Consider this example. You create a search index in which the indexed chunk data model object
(CDMO) is in a 1:N relationship with related records from which a pre-filtering value is
extracted. In the relationship, the CDMO {"chunkId":"1"} matches both
{"filterRecordId"="123": "filterValue": "tag1"} and
{"filterRecordId"="123": "filterValue": "tag2”}.
Data 360 indexes only one of these filtered values for retrieval, and there’s no guarantee
which one is indexed. For example, Data 360 may index{"chunkId":"1",
"filterValue":"tag1"} or {"chunkId":"1", "filterValue":"tag2"} but
not {"chunkId":"1", "filterValue":["tag1", "tag2”]}.
Join Expressions in Hybrid Search
Include joins to access fields from both the Chunk DMO and Search Index DMO associated with the index.
SELECT
src.ArticleNumber__c,
hsearch.hybrid_score__c
FROM
hybrid_search(
TABLE(Knowledge_index__dlm),
'DataWedge Decode Volume',
'',
10
) hsearch
join Knowledge_chunk__dlm chnk
on hsearch.SourceRecordId__c = chnk.RecordId__c
join Knowledge_kav_Home__dlm src
on chnk.SourceRecordId__c = src.Id__c

