Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Conversation

@mieciu
Copy link
Member

@mieciu mieciu commented Jun 2, 2025

An attempt to introduce unique object IDs in the ClickHouse realm.

A returned document id (_id field) would have the following syntax:

{hex-encoded timestamp field}qqq{hex-encoded hash of the document}

Of course, the {hex-encoded hash of the document} lives only in Quesma memory:

  1. It needs to be re-calculated when returning search hits
  2. Quesma need to filter out based on it when rendering hits

Therefore when fetching document with specific _id we could filter out documents with matching timestamp and then filter for that with matching fields, returning the right entry.

This fixes the issue, where JSON view of single document could return a random object from search hits, not necessarily the one clicked.
image

However (and it's a pretty big however), the "surrounding document" view cannot return the surrounding documents. While the query doesn't error it also doesn't return any documents. The experiment to have that working is carried out is a separate PR, although it's not clear yet if this way of doing things is going to guarantee 100% correctness.

@mieciu mieciu marked this pull request as ready for review June 5, 2025 18:41
@mieciu mieciu requested a review from a team as a code owner June 5, 2025 18:41
@mieciu
Copy link
Member Author

mieciu commented Jun 5, 2025

/run-it

@mieciu mieciu force-pushed the unique-ids branch 2 times, most recently from 15abb93 to d0e8e70 Compare June 6, 2025 07:35
@mieciu
Copy link
Member Author

mieciu commented Jun 6, 2025

/run-it

Copy link
Contributor

@jakozaur jakozaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments.

@mieciu
Copy link
Member Author

mieciu commented Jun 6, 2025

/run-it

@mieciu mieciu enabled auto-merge June 6, 2025 09:50
@mieciu mieciu disabled auto-merge June 6, 2025 09:53
@mieciu mieciu enabled auto-merge June 6, 2025 09:54
@mieciu
Copy link
Member Author

mieciu commented Jun 6, 2025

Force pushed as GitHub status went stuck 🤷

@mieciu mieciu added this pull request to the merge queue Jun 6, 2025
Merged via the queue into main with commit 871ba58 Jun 6, 2025
5 checks passed
@mieciu mieciu deleted the unique-ids branch June 6, 2025 10:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants