Skip to content

[bugfix] asterisk and dot in element()-typed args in field @expression#6461

Open
duncdrum wants to merge 3 commits into
eXist-db:developfrom
duncdrum:dp-lucene-dots
Open

[bugfix] asterisk and dot in element()-typed args in field @expression#6461
duncdrum wants to merge 3 commits into
eXist-db:developfrom
duncdrum:dp-lucene-dots

Conversation

@duncdrum

@duncdrum duncdrum commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

build the NodeProxy once in LuceneIndexWorker.write(), where the PendingDoc qname is in scope to determine element vs. attribute, then pass it through build()/doBuild()/checkCondition() as the evaluation context. This removes DocumentImpl/NodeId/short from those signatures and
makes the abstraction explicit: callers supply the context node, field configs evaluate against it.

close #6446

@duncdrum duncdrum added the Lucene issue is related to Lucene or its integration label Jun 9, 2026
@duncdrum duncdrum added this to v7.0.0 Jun 9, 2026
@duncdrum duncdrum added this to the eXist-7.0.0 milestone Jun 9, 2026
@duncdrum duncdrum marked this pull request as ready for review June 9, 2026 15:05
@duncdrum duncdrum requested a review from a team as a code owner June 9, 2026 15:05
@duncdrum duncdrum moved this to In review in v7.0.0 Jun 9, 2026

@line-o line-o left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think that switching to operate on a contextNode (an instance of NodeProxy) from handing over a document and a nodeId is a good approach.

At least to me this simplifies the mental model I have to maintain as I can be sure that the only operations within those functions operate on the node rather than the document that the node is in.

The fixes in this PR are valuable and important.

@line-o

line-o commented Jun 10, 2026

Copy link
Copy Markdown
Member

@duncdrum I don't know what a civer vector is. Is it a typo or a thing. If it is a thing could you explain it?

@line-o

line-o commented Jun 10, 2026

Copy link
Copy Markdown
Member

asterix => asterisk

@duncdrum duncdrum changed the title [bugfix] asterix and dot in element()-typed args in field @expression [bugfix] asterisk and dot in element()-typed args in field @expression Jun 10, 2026
@duncdrum

Copy link
Copy Markdown
Contributor Author

civer -> cover

@line-o

line-o commented Jun 10, 2026

Copy link
Copy Markdown
Member

@duncdrum Could you fix the typos in the commit messages as well?

@line-o line-o requested a review from a team June 10, 2026 10:20
duncdrum added 3 commits June 10, 2026 12:27
build the NodeProxy once in LuceneIndexWorker.write(), where the
PendingDoc qname is in scope to determine element vs. attribute, then
pass it through build()/doBuild()/checkCondition() as the evaluation
context. This removes DocumentImpl/NodeId/short from those signatures
and
makes the abstraction explicit: callers supply the context node, field
configs evaluate against it.

close eXist-db#6446
`isValid = false` in `doBuild()` and `checkCondition()` silently kill a
field for all subsequent documents when one document's expression
evaluation failed. The flag belongs only in compile() — a runtime
exception means this document failed, not that the expression is broken.
compiled.reset() already restores clean state for the next call.

Also nest compiled.reset() in try/finally so getContext().reset() always
runs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Lucene issue is related to Lucene or its integration

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

Lucene indexing fails if expression attribute contains self::* or function is called with self::* or . (dot)

2 participants