{"meta":{"title":"搜寻","intro":"搜索类别中 GraphQL 架构类型的参考文档。","product":"GraphQL API","breadcrumbs":[{"href":"/zh/graphql","title":"GraphQL API"},{"href":"/zh/graphql/reference","title":"参考"},{"href":"/zh/graphql/reference/search","title":"搜寻"}],"documentType":"article"},"body":"# 搜寻\n\n搜索类别中 GraphQL 架构类型的参考文档。\n\n## LexicalFallbackReason - enum\n\nReason why a semantic or hybrid issue search fell back to lexical search.\n\n### Values for `LexicalFallbackReason`\n\n* `NON_ISSUE_TARGET`: Query targets non-issue types (e.g., pull requests).\n* `NO_ACCESSIBLE_REPOS`: Scoped query resolved to zero accessible repositories.\n* `NO_TEXT_TERMS`: Query has only qualifiers and no free text terms.\n* `ONLY_NON_SEMANTIC_FIELDS_REQUESTED`: Query uses an in: qualifier targeting non-semantic fields.\n* `OR_BOOLEAN_NOT_SUPPORTED`: Query contains OR operators (nested boolean qualifiers).\n* `QUOTED_TEXT`: Query contains quoted text requiring exact matches.\n* `SERVER_ERROR`: Embedding generation failed or timed out.\n\n## search - query\n\nPerform a search across resources, returning a maximum of 1,000 results.\n\n**Type:** SearchResultItemConnection!\n\n### Arguments for `search`\n\n* `after` (String): Returns the elements in the list that come after the specified cursor.\n* `before` (String): Returns the elements in the list that come before the specified cursor.\n* `first` (Int): Returns the first n elements from the list.\n* `last` (Int): Returns the last n elements from the list.\n* `query` (String!): The search string to look for. GitHub search syntax is supported. For more\ninformation, see \"Searching on\nGitHub,\"\n\"Understanding the search syntax,\"\nand \"Sorting search results.\".\n* `type` (SearchType!): The types of search items to search within.\n\n## SearchResultItem - union\n\nThe results of a search.\n\n### Possible types for `SearchResultItem`\n\n* App\n* Discussion\n* Issue\n* MarketplaceListing\n* Organization\n* PullRequest\n* Repository\n* User\n\n## SearchResultItemConnection - object\n\nA list of results that matched against a search query. Regardless of the number\nof matches, a maximum of 1,000 results will be available across all types,\npotentially split across many pages.\n\n### Fields for `SearchResultItemConnection`\n\n* `codeCount` (Int!): The total number of pieces of code that matched the search query. Regardless\nof the total number of matches, a maximum of 1,000 results will be available\nacross all types.\n* `discussionCount` (Int!): The total number of discussions that matched the search query. Regardless of\nthe total number of matches, a maximum of 1,000 results will be available\nacross all types.\n* `edges` ([SearchResultItemEdge]): A list of edges.\n* `issueCount` (Int!): The total number of issues that matched the search query. Regardless of the\ntotal number of matches, a maximum of 1,000 results will be available across all types.\n* `issueSearchType` (IssueSearchType): The type of search that was performed for issues (lexical, semantic, or hybrid).\n* `lexicalFallbackReason` ([LexicalFallbackReason!]): When a semantic or hybrid search falls back to lexical, the reasons why the fallback occurred.\n* `nodes` ([SearchResultItem]): A list of nodes.\n* `pageInfo` (PageInfo!): Information to aid in pagination.\n* `repositoryCount` (Int!): The total number of repositories that matched the search query. Regardless of\nthe total number of matches, a maximum of 1,000 results will be available\nacross all types.\n* `userCount` (Int!): The total number of users that matched the search query. Regardless of the\ntotal number of matches, a maximum of 1,000 results will be available across all types.\n* `wikiCount` (Int!): The total number of wiki pages that matched the search query. Regardless of\nthe total number of matches, a maximum of 1,000 results will be available\nacross all types.\n\n## SearchResultItemEdge - object\n\nAn edge in a connection.\n\n### Fields for `SearchResultItemEdge`\n\n* `cursor` (String!): A cursor for use in pagination.\n* `node` (SearchResultItem): The item at the end of the edge.\n* `textMatches` ([TextMatch]): Text matches on the result found.\n\n## SearchType - enum\n\nRepresents the individual results of a search.\n\n### Values for `SearchType`\n\n* `DISCUSSION`: Returns matching discussions in repositories.\n* `ISSUE`: Returns results matching issues in repositories.\n* `ISSUE_ADVANCED`: Returns results matching issues in repositories.\n* `ISSUE_HYBRID`: Returns results matching issues using hybrid (lexical + semantic) search.\n* `ISSUE_SEMANTIC`: Returns results matching issues using semantic search.\n* `REPOSITORY`: Returns results matching repositories.\n* `USER`: Returns results matching users and organizations on GitHub.\n\n## TextMatch - object\n\nA text match within a search result.\n\n### Fields for `TextMatch`\n\n* `fragment` (String!): The specific text fragment within the property matched on.\n* `highlights` ([TextMatchHighlight!]!): Highlights within the matched fragment.\n* `property` (String!): The property matched on.\n\n## TextMatchHighlight - object\n\nRepresents a single highlight in a search result match.\n\n### Fields for `TextMatchHighlight`\n\n* `beginIndice` (Int!): The indice in the fragment where the matched text begins.\n* `endIndice` (Int!): The indice in the fragment where the matched text ends.\n* `text` (String!): The text matched."}