Search
The Search API in the Manufacturing Data Model provides a unified way to locate Components, Models, Files, and Folders within a Fusion hub. It supports free-text lookups, property-based filtering, type-scoped searches, sorting, and cursor-based pagination. Search is intended for discoverability, allowing users and systems to find relevant objects when their exact IDs are unknown. Each result includes match details and a typed object reference that can be used with other MFGDM queries to retrieve complete information.
Searchable Properties
Not all hub properties support searching or sorting, so the searchablePropertiesByHub query provides the list of properties that can be used when constructing searchFields or sort conditions. It returns a localized display name suitable for UI presentations and a propertyDefinition.id that is used in search inputs. Applications typically call this query when building a filter panel or configuring metadata-driven search behavior.
query SearchablePropertiesByHub($hubId: ID!) {
searchablePropertiesByHub(hubId: $hubId) {
results {
displayName
propertyDefinition {
id
isSearchable
}
}
}
}
How searchByHub Works
The searchByHub query performs searches across a hub using a combination of text, metadata, and type selection. Free-text queries allow for broad matching across common fields such as names or part numbers. Metadata-driven filtering is performed through searchFields, which use propertyDefinition.id values obtained from the searchablePropertiesByHub query. These two approaches can be used independently or in combination depending on the workflow.
The query also allows callers to limit which types of objects may appear in results using the desiredSearchResultTypes parameter. This helps keep results focused on the workflow being implemented without preventing broader searches when necessary. Sorting can be applied using searchable property IDs, and pagination is handled through a cursor, enabling consistent navigation through large result sets. Together, these inputs provide a flexible model for searching across the contents of a Fusion hub.
Returned Results
A search result contains the object’s display name, information about which properties matched the criteria, and a typed object that identifies whether the item is a Component, Model, File, or Folder. When a query includes a mix of result types, callers may request a score field to help order results by relevance. The score is optional and appears only when explicitly selected in the GraphQL query. Match details help clarify why a result was included, and the typed object reference allows callers to request additional type-specific fields using inline fragments within the search query itself.
Search Usage
Free-text search is useful when only partial information is known or when exploring a large hub. Property-based search allows for precise filtering based on metadata and is suited for structured workflows such as material or classification filtering. Combined searches offer flexibility, allowing a query to be both keyword-driven and metadata-driven.
Type selection keeps searches focused on the relevant object categories, and sorting provides consistent ordering based on metadata fields. Pagination enables applications to handle large result sets across multiple pages. Additional object details can be requested directly within the search query using GraphQL inline fragments, or callers may choose to retrieve only IDs initially and fetch full details in subsequent queries as needed.
Search Query Examples
Free-text Search
The following example demonstrates a simple free-text search for components or models matching the keyword “bolt”:
query SearchByHub($hubId: ID!) {
searchByHub(
hubId: $hubId
searchCriteria: { query: "bolt" }
) {
results {
name
matches {
matchedPropertyId
matchedText
}
searchResultObject {
__typename
... on Component { id }
... on Model { id }
}
}
}
}
Component-only Search
To limit search results to only Components, use the desiredSearchResultTypes parameter:
query SearchByHub($hubId: ID!) {
searchByHub(
hubId: $hubId
searchCriteria: {
query: "Knife"
desiredSearchResultTypes: [COMPONENT]
}
) {
results {
name
matches {
matchedPropertyId
matchedText
}
searchResultObject {
__typename
... on Component { id }
}
}
}
}
Property-based Search
Search based on specific property values using searchFields. The searchableProperty ID must be obtained from the searchablePropertiesByHub query:
query SearchByHub($hubId: ID!, $propId: ID!) {
searchByHub(
hubId: $hubId
searchCriteria: {
searchFields: [
{
searchableProperty: $propId
PropertyQuery: ["Steel"]
}
]
}
) {
results {
name
matches {
matchedPropertyId
matchedText
}
searchResultObject {
__typename
... on Component { id }
... on Model { id }
}
}
}
}
Mixed Search with Score
When searching across multiple object types, you can request a score field to help rank results by relevance:
query SearchByHub($hubId: ID!) {
searchByHub(
hubId: $hubId
searchCriteria: {
query: "A"
desiredSearchResultTypes: [FILE, FOLDER, COMPONENT, MODEL]
}
) {
results {
name
score
matches {
matchedPropertyId
matchedText
}
searchResultObject {
__typename
... on Component { id }
... on Model { id }
... on DesignItem { id }
... on DrawingItem { id }
... on BasicItem { id }
... on ConfiguredDesignItem { id }
... on Folder { id }
}
}
}
}
Sorting
Apply sorting to search results using searchable property IDs:
query SearchByHub($hubId: ID!, $propId: ID!) {
searchByHub(
hubId: $hubId
searchCriteria: {
query: "Bracket"
sort: [
{
propertyId: $propId
order: ASC
}
]
}
) {
results {
name
matches {
matchedPropertyId
matchedText
}
searchResultObject {
__typename
... on Component { id }
... on Model { id }
}
}
}
}
Pagination
Use cursor-based pagination to navigate through large result sets. The cursor returned in the response can be used to fetch the next page of results:
query SearchByHub($hubId: ID!, $cursor: String) {
searchByHub(
hubId: $hubId
searchCriteria: { query: "bolt" }
pagination: { cursor: $cursor, limit: 20 }
) {
results {
name
matches {
matchedPropertyId
matchedText
}
searchResultObject {
__typename
... on Component { id }
... on Model { id }
}
}
pagination {
cursor
}
}
}
Workflow Summary
A typical workflow begins by retrieving a hub’s searchable properties, then constructing a search query using a combination of text, metadata filters, type selection, or sorting depending on the use case. The results indicate what matched and provide typed references that can be used to retrieve full details. Pagination helps users navigate larger hubs without overwhelming the response. This approach supports both broad exploration and highly targeted filtering across Fusion data.
Additional Notes
- Sorting requires a searchable property ID.
- Text and metadata filtering may be used together or independently.
- More detailed field descriptions, supported types, and response structures can be found in the API Reference pages for
searchByHubandsearchablePropertiesByHub.