Search
Quick Start
query Search {
search(
searchInput: {
searchQuery: "How do I get started?"
organizationId: "<YOUR_ORG_ID>"
integrationId: "<YOUR_INTEGRATION_ID>"
filters: {}
searchMode: AUTO
}
) {
searchHits {
id
preview
title
url
}
}
}
Want to try out a REST version of our API? Contact us at support@inkeep.com for the documentation. It’s a native proxy on top of our GraphQL API with equivalent functionality.
Reference
search
Argument | Type | Description |
---|---|---|
searchInput | SearchInput | Required. The search parameters that will be used in the query. |
Input Types
SearchInput
Property | Type | Description |
---|---|---|
searchQuery | String! | Required. The search query string. |
organizationId | ID! | Required. The ID of the organization. |
integrationId | ID | The ID of the integration. |
searchMode | SearchMode | The mode of the search (AUTO , KEYWORD , INTELLIGENT ). |
filters | SearchFiltersInput | The search filters input. |
SearchFiltersInput
When we ingest content, we add metadata to the content that is filterable in our search and chat APIs.
For example, if you have multiple products or version your product, you can “scope” the search results if you know the product or product version that the user is interested in.
This might be based on:
- the URL the user is viewing
- a product or version picker in your docs or chat UX
- in-app context you have about the user, like which products or versions they use
By default, we label source documents with a product and product version if it can be inferred from your HTML or URL structure.
If you use our ingestion APIs, you can add your own ‘attributes’ that are filterable to the source documents and create your own filter queries based on that.
Property | Type | Description |
---|---|---|
product | String | The product name. Used to scope the response to content relevant to a specific product. |
productVersion | String | The product version name. Used to scope the response to content relevant to a specific product version. |
sourceIds | String | The source IDs. |
attributes | JSON | The attributes. |
limit | Int | The maximum number of search results to return. Defaults to 40 . |
Filter attributes
Our attributes filtering schema is based on MongoDB’s query and projection operators. We currently support $in
, $not
, $and
and $or
operators or conditions.
The attributes
value should be valid within this schema. See an example below
{
"attributes": {
"$and": [
{ "env": "production" },
{ "modules": { "$in": ["module1", "module2"] } }
]
}
}
Note that all filters are assumed to follow $and
and by exclusive by default, unless using the $or
operator.
That is, sources not meeting those filters will not be used in the chat response.
Filtering by URLs
You can filter by the URLs by using the recordUrlsByRegex
and recordUrlsByExact
patterns as illustrated below.
{
"attributes": {
"$and": [
{
"recordUrlsByRegex": {
"$in": [".*inkeep.*"]
}
},
{
"recordUrlsByExact": {
"$in": ["https://www.inkeep.com/product/1.0"]
}
}
]
}
}
Enum Types
SearchMode
Values |
---|
AUTO |
KEYWORD |
INTELLIGENT |
RecordType
Values |
---|
DOCUMENTATION |
Note: The public API for other content sources like GitHub, StackOverflow, Discourse, and others is coming soon. Those sources are currently available in the Inkeep React or JS Widgets for everyone.
Object Types
SearchResult
Property | Type | Description |
---|---|---|
searchHits | [SearchHit!]! | An array of search hits. |
searchQuery | String! | The search query that produced this search result. |
SearchHit
Property | Type | Description |
---|---|---|
id | ID! | A unique ID across all records and sources. |
rootRecord | SearchRootRecord! | The root record for this hit. |
hitOnRoot | Boolean! | Indicates if the hit was on the root. |
url | String | The URL of the hit. |
title | String | The title of the hit. |
preview | String | A preview of the hit. |
SearchRootRecord
Property | Type | Description |
---|---|---|
id | ID! | A unique ID across all records and all sources. |
title | String | The title of the root record. |
url | String | The URL of the root record. |
preview | String | A preview of the root record. |
Specific Hit Types
DocumentationHit
Property | Type | Description |
---|---|---|
id | ID! | A unique ID across all records and sources. |
rootRecord | DocumentationRecord! | The root document record for this hit. |
url | String | The URL of the hit document. |
title | String | The title of the hit document. |
preview | String | A preview of the text that generated the hit. |
content | DocumentContentLevel | The content (‘chunk’) of the document section that resulted in the hit. This could be a breadcrumb, title, sub-section heading, paragraph, or table. |
pathHeadings | [DocumentContentLevel]! | A list of document chunks starting from the level heading. |
hitOnRoot | Boolean! | Indicates if the hit was on the root document and not a specific sub-section of the document. |
DocumentationRecord
Property | Type | Description |
---|---|---|
id | ID! | A unique ID across all records and all sources. |
title | String | The title of the record. |
url | String | The URL of the record. |
preview | String | A preview of the record. |
pathBreadcrumbs | [String!]! | An array representing the breadcrumb path for the record. Example: ["Docs", "Version 8", "API"] |
contentType | String! | The content type of the record Example: ‘Blog’. |
topLevelHeadings | [DocumentContentLevel]! | The top-level headings of the document (likely to be h2 elements) |
firstContentPath | [DocumentContentLevel]! | The path to the first content (chunk) in the document. |
firstContent | String | The text of the first content (chunk) in the document. |
DocumentContentLevel
Property | Type | Description |
---|---|---|
anchor | String | The anchor for the document content level. |
url | String | The URL of the document content level. |
htmlTag | String! | The HTML tag of the content. Examples: ‘code’, ‘p’, ‘h1’, ‘h2’. |
content | String! | The raw text content of the document content level. |