Skip to content

fix: set context=off on database. - #205

Open
pantierra wants to merge 1 commit into
IFRCGo:developfrom
pantierra:fix/context-off
Open

fix: set context=off on database.#205
pantierra wants to merge 1 commit into
IFRCGo:developfrom
pantierra:fix/context-off

Conversation

@pantierra

@pantierra pantierra commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Disables expensive numberMatched/context counting on large collections.

Existing collections need to be migrated manually.

@wrynearson

Copy link
Copy Markdown

@thenav56 could you please review and merge if approved?

@thenav56

thenav56 commented Sep 1, 2026

Copy link
Copy Markdown
Member

Sure @wrynearson

Merging this PR will update both staging and production. Do you think we should try it on staging first?

@wrynearson

Copy link
Copy Markdown

@pantierra @batpad and @szabozoltan69 are working on this currently, so hold off on merging – I defer the merge/deploy strategy decision to them.

@batpad

batpad commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Am pretty sure this is independent of the database cleanups / tuning that @szabozoltan69 and @pantierra are working on. However, this will result in an API change for end-users - i.e. total counts will no longer be available in the API. It would be good to clearly document what the API change will be after setting context to off and what changes for consumers - some of the existing notebooks that use counts, for example, might break.

@pantierra would you be able document / point to documentation of exactly what the API change would be after setting context to off? And then would get a look from maybe @arunissun and @wrynearson . This one is probably good to separate out staging and prod and just deploy to staging first and let people test?

@pantierra

Copy link
Copy Markdown
Contributor Author

With context=off, afaik the only visible API change is that numberMatched disappears from /search and /collections responses (no total-count field), while everything else stays the same.

@batpad

batpad commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@wrynearson can you take a call and sign off on whether that API change seems okay (and handle any potential comms around it)? And if that seems okay, @thenav56 to approve and merge?

@wrynearson

Copy link
Copy Markdown

@batpad @pantierra The primary use of the numberMatched (AFAIK) is to understand the amount of items, which is used for queries in the LLM-assisted interfaces for broader questions (e.g., how many floods were there in India in the last 5 years).

I think it's OK to turn it off to improve performance. We can explore elsewhere the best way to give broader count info to users (e.g., developmentseed/esa-montandon#33).

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.

4 participants