Open scheidelerl opened 2 months ago
@scheidelerl Thank you for this complete issue report. I would like to know with which version of exist-db the above test-suite passes.
In order to read values of binary fields a new function was added ft:binary-field
and I cannot see you using it. Maybe that is the issue?
see also https://exist-db.org/exist/apps/doc/lucene#retrieve-fields "Retrieving Field Content"
Hey,
thank you for the reply.
The eXist-db Version is the current build 6.2.0. Installed with the JAR Installer.
If I use ft:binary-field($index, ‘sortable’, ‘xs:string’)
instead, which I think should be the intended way of using it, it doesn't work either.
In eXide the attribute binary
show this linter error : [cvc-complex-type.3.2.2: Attribute 'binary' is not allowed to appear in element 'field']
The eXist log file does not say anything about it.
If I use the field without binary
no problem occur.
If I try to apply the collection.xconf with eXide this error occurs: Failed to apply configuration: DocValuesField "sortable" appears more than once in this document (only one value is allowed per field)
If I use only doc("/db/test/test.xml")/div[ft:query(., ())]
with the binary
attribute in the field child, the result is empty, and ft:field($node as node(), $field as xs:string)
and ft:binary-field($node as node(), $field as xs:string, $type as xs:string)
throw this errors:
err:XPTY0004 It is a type error if, during the static analysis phase, an expression is found to have a static type that is not appropriate for the context in which the expression occurs, or during the dynamic evaluation phase, the dynamic type of a value does not match a required type as specified by the matching rules in 2.5.4 SequenceType Matching. checking function parameter 1 in call ft:field($index, "sortable"): XPTY0004: The actual cardinality for parameter 1 does not match the cardinality declared in the function's signature: ft:field($node as node(), $field as xs:string) item()*. Expected cardinality: exactly one, got 0.
err:XPTY0004 It is a type error if, during the static analysis phase, an expression is found to have a static type that is not appropriate for the context in which the expression occurs, or during the dynamic evaluation phase, the dynamic type of a value does not match a required type as specified by the matching rules in 2.5.4 SequenceType Matching. checking function parameter 1 in call ft:binary-field($index, "sortable", "xs:string"): XPTY0004: The actual cardinality for parameter 1 does not match the cardinality declared in the function's signature: ft:binary-field($node as node(), $field as xs:string, $type as xs:string) item()*. Expected cardinality: exactly one, got 0.
And I know what it means, it's self-explanatory. But it means that it does not perform the full index because an error occurs. Which is not listed in the log or otherwise and is ultimately related to the attribute, because it works without it.
@scheidelerl you need to have some hits in order to sort them using the binary field values. I suspect that your call to ft:query
returns an empty sequence. Can you check that?
In eXide the attribute binary show this linter error : [cvc-complex-type.3.2.2: Attribute 'binary' is not allowed to appear in element 'field']
It can very well be, that the schema was not updated to add the binary attribute.
I updated the test above and added a new one, one with and one without binary
.
It works when I use the element directly, because binary
seems to need a single value.
The hint was the error with the index apply in eXide.
This brings me to the following questions:
xs:string
? type="xs:string*"
to prevent this error?!!!! → 6. What do I have to do if I only want to perform a query above the parent level and have several values in one field, but want to have faster access?
Why this works in 5.4.0?
As far as I know binary fields were added in version 6.2.0. That means it cannot work in version 5.4.0.
Describe the bug The use of
binary
attribute for fields in full text index does not work any more.Expected behavior The use of the
binary
attribute should work.To Reproduce Try to index a field with as
binary
.With binary:
Without binary:
Context (please always complete the following information)
Additional context