advanced-query-loop icon indicating copy to clipboard operation
advanced-query-loop copied to clipboard

Only most recent published post available to select in excluded posts field

Open leebdev opened this issue 2 months ago • 3 comments

When attempting to add posts to be excluded only the most recent published post appears in the list, both in its initial state and after typing search text into the field. Manually adding a title doesn't persist when the post is updated.

This is being used on a site with a large number (6k +) posts.

Image

leebdev avatar Oct 09 '25 11:10 leebdev

Sorry you're running into this and thank you for opening this issue. I'll see if I can replicate this bug go from there.

ryanwelcher avatar Oct 13 '25 13:10 ryanwelcher

I’m experiencing this issue as well.

turtlepod avatar Oct 16 '25 19:10 turtlepod

@ryanwelcher I think the problem comes from a mismatch between how the search REST API works and how the FormTokenField handles results.

FormTokenField only displays suggestions when the keyword matches the actual result text — in this case, the post title. However, the REST API searches not only in post titles, but also in post content.

For example, let’s say the REST API returns 10 results for the keyword “Stone.” If none of those 10 posts have “Stone” in their titles (only in their content), the autocomplete will show “no results.”

This creates a major issue: if you’re trying to find a post with “Stone” in the title — and it happens to be the 12th item in the REST API response — it will never appear in the autocomplete, since the first 10 results are already filled with posts where “Stone” appears only in the content.

Maybe the solution is to increase the number of results fetched — for example, change the query limit from 10 to 100 or even 500 posts to get more matches.

Alternatively, we could consider using a different component for the autocomplete functionality.

turtlepod avatar Oct 17 '25 00:10 turtlepod