Area: Product
Sub-Area: Search
Applies to: OSS + Cloud
Issue
Default search results don't match your organization's priorities. You want to boost certain datasets, platforms or domains so the most relevant assets appear first.
You Might Be Asking
- How do I customize search rankings?
- Can I boost specific datasets in search?
- How does search relevance scoring work?
- Do custom properties change ranking?
Cause
Ranking depends on your deployment:
- DataHub Core (self-hosted): results rank by how closely the query matches textual fields.
- DataHub Cloud: ranking combines textual relevance, usage (queries and views) and change frequency.
There are no elasticsearch.search.weights or elasticsearch.search.boosts settings. Self-hosted deployments tune ranking with a search configuration YAML file instead.
Solution
DataHub Cloud
You can't change GMS environment variables, Helm values or server configuration in Cloud. To ask about ranking behavior, contact DataHub Support.
You can narrow results with filters and Advanced Filters. Advanced Filters can match all filters or any filter, and each one can be negated. See Advanced filters.
Self-hosted DataHub
- Make sure custom search configuration is on. GMS reads it from
ELASTICSEARCH_QUERY_CUSTOM_CONFIG_ENABLED(defaulttrue). - Point GMS at your file with
ELASTICSEARCH_QUERY_CUSTOM_CONFIG_FILE. The default inapplication.yamlissearch_config.yaml. The docs showsearch_config.yml, so use the name that matches your setting. - In the file, list profiles. Each profile is selected by a
queryRegexand can haveboolQueryandfunctionScoresections.functionScorepasses through to the Elasticsearchfunction_scorequery. - Use any field in the entity's search document in your rules, including
customProperties,tags,termsanddomain. - Autocomplete has its own
autocompleteConfigurations. They inherit search scoring unless you override them. - Test the file before you use it in production. Syntax errors are possible.
See Customizing Search for the file format and examples.
Custom properties
customProperties values are indexed as text and are searched by default. They have no boost score. To use a custom property in ranking on a self-hosted deployment, reference it in your search configuration file.
If you write custom properties with the Python SDK, note that emit_mcp takes a single mcp argument (a MetadataChangeProposal or MetadataChangeProposalWrapper). It has no entity_urn, aspect_name or aspect keyword arguments.
Re-ranking results in your own code
If you search with GraphQL and re-rank in your own code, keep these points in mind:
-
search(input: SearchInput!)searches one entity type.typeandqueryare required. UsesearchAcrossEntitiesto search several types or to sort. See searchAcrossEntities. -
filtersonSearchInputis deprecated. UseorFilters. - Platform filter values must be full URNs, not bare names. For example:
{
"input": {
"type": "DATASET",
"query": "customer data",
"start": 0,
"count": 100,
"orFilters": [
{ "and": [ { "field": "platform", "values": ["urn:li:dataPlatform:snowflake"] } ] }
]
}
}
- In the Python SDK,
DataHubGraph.execute_graphql(query, variables=...)returns the GraphQLdatapayload. Read results asresult['search']['searchResults'], notresult['data']['search']['searchResults']. -
searchFlagsdoes not sort results. Sorting issortInputonsearchAcrossEntities. - For Cloud, connect the SDK to
https://<your-instance>.acryl.io/gmswith a personal access token. - For more than 10,000 results, use
scrollAcrossEntities. See Searching at scale.