Skip to content

FreeScout: Search conversations' text through the API - #4

Open
frantorres wants to merge 4 commits into
obenland:add/freescout-plugin-reviewfrom
frantorres:fran/freescout-api-search-plugin-ids
Open

frantorres wants to merge 4 commits into
obenland:add/freescout-plugin-reviewfrom
frantorres:fran/freescout-api-search-plugin-ids

Conversation

@frantorres

@frantorres frantorres commented Oct 17, 2026 •

Copy link
Copy Markdown

WPOrgSite: text search in GET /api/conversations

  • body lists the conversations with a published email, reply or note containing the passed text; bodyThreadType, bodySince and bodyBefore narrow which threads are read.
  • Bounded: the other filters pick the conversations first (indexed), their threads are counted, then read in chunks; searches over 15,000 threads or 25,000 conversations are refused (both filterable). The matches go back as IDs, so the count and the page don't search again.
  • Refusals and failures answer 400/500 rather than an empty list, which would read as "no match".

The plugin ID lookup (reviewPluginId) moved to WordPress#1035. On a synthetic copy (200k conversations, 1.4M threads, ~3 GB of recent emails), finding a plugin's review by text reads ~40,000 team emails in ~5.7 s; by reviewPluginId it's an index lookup.

@frantorres
frantorres marked this pull request as ready for review October 17, 2026 19:25
@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props frantorres, obenland.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@obenland
obenland force-pushed the add/freescout-plugin-review branch from 38e8f63 to a25bc6d Compare October 20, 2026 16:44
WPOrgSite: `GET /api/conversations` takes `body`, listing the conversations
with a published email, reply or note containing the text, narrowed by
`bodyThreadType`, `bodySince` and `bodyBefore`. The other parameters pick the
conversations first, their threads are counted from the index and then read in
chunks, and searches over 15,000 threads or 25,000 conversations are refused.

WPOrgPluginReview: the review email index keeps each email's plugin ID, from
its Review ID line, and `GET /api/conversations` takes `reviewPluginId` to list
a plugin's conversations. The migration queues a batched backfill of the rows
indexed before (`wporgpluginreview:index --plugin-ids`).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@obenland
obenland force-pushed the fran/freescout-api-search-plugin-ids branch from f0f58f6 to 0c05404 Compare October 20, 2026 18:57
obenland and others added 2 commits October 20, 2026 14:05
WPOrgPluginReview isn't deployed yet, so its table gets the plugin_id column
when it's created: no migration, backfill job, `--plugin-ids` option, or 503
while the column is missing. Local environments rebuild the table.

Shortens the docblocks and comments to what the code doesn't say, and
removes only the test's own filters instead of every filter on the hook.
Bumps WPOrgSite to 1.2.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The measurements belong in the pull request; the README keeps the
parameters, an example, the limits, and the errors. Why the matches go
back as IDs moves to the code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
obenland added a commit that referenced this pull request Oct 20, 2026
The index of review emails keeps each one's plugin ID, from the P0TDX…HGN
of its Review ID line, and the API's conversation list takes it as
`reviewPluginId`: an indexed lookup of a plugin's review conversations,
whatever their status, for the review tools.

From #4.

Co-Authored-By: Konstantin Obenland <obenland@gmx.de>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fran/freescout-api-search-plugin-ids

# Conflicts:
#	freescout.wordpress.net/Modules/WPOrgPluginReview/README.md
#	freescout.wordpress.net/Modules/WPOrgPluginReview/tests/PluginConversationsTest.php
@obenland obenland changed the title Freescout: API text search and plugins id indexing FreeScout: Search conversations' text through the API Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants