Ensure Elasticsearch documents have an _id and track content hash for partial updates #2012
+38
−20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This uses
Url
as our_id
This allows us to do direct GET request based on urls.
And we store a hash of the contents.
This allows us to conditionally update a document only if the hash has changed
However because we use semantic fields the equivalent is not allowed in
_bulk
operationsSee https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/semantic-text#semantic-text-updates for the rules that prevent it currently. Opened elastic/elasticsearch#136074 to discuss with Elasticsearch team.
The only option i see now is to first index into an index without semantic fields then search for updates through scroll and feed it to bulk index updates into the index with semantic fields.
Side note
The mapping for
url
is updated to use the path hierarchy tokenizer so its easier for us to constrain searches to specific locations e.g