NotionX / NotionX/react-notion-x

Search returns no result

Open
#583 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5.4k
Forks
645
PR merge metrics
No merged PRs in 30d

Description

Description

It seems that Notion search API now requires a "includePublicPagesWithoutExplicitAccess": true field present in filter object of search request payload. Without that field, search will return an empty result set.

Notion Test Page ID

1197d259b2558072b6e7d0be8e03a215

Without the field:

curl 'https://www.notion.so/api/v3/search' \
  -H 'content-type: application/json' \
  --data '{"type":"BlocksInAncestor","query":"test","ancestorId":"1197d259-b255-8072-b6e7-d0be8e03a215","filters":{"isDeletedOnly":false,"excludeTemplates":false,"navigableBlockContentOnly":false,"requireEditPermissions":false,"ancestors":[],"createdBy":[],"editedBy":[],"lastEditedTime":{},"createdTime":{},"inTeams":[] },"sort":{"field":"relevance"},"limit":20,"source":"quick_find_input_change"}'

The returned results is empty.

With the field:

curl 'https://www.notion.so/api/v3/search' \
  -H 'content-type: application/json' \
  --data '{"type":"BlocksInAncestor","query":"test","ancestorId":"1197d259-b255-8072-b6e7-d0be8e03a215","filters":{"isDeletedOnly":false,"excludeTemplates":false,"navigableBlockContentOnly":false,"requireEditPermissions":false,"includePublicPagesWithoutExplicitAccess":true,"ancestors":[],"createdBy":[],"editedBy":[],"lastEditedTime":{},"createdTime":{},"inTeams":[] },"sort":{"field":"relevance"},"limit":20,"source":"quick_find_input_change"}'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating where the Notion search request and its filters are constructed in the TypeScript code. Reproduce the issue with the provided curl payload and test page ID, then verify that searches return results when the required filter field is included.

Written by the indexing model from the issue text.

Assessment

Tech stack
nextjs, react, typescript
Domain
api, backend, search
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.