I apologize as well; I missed to consider one more edge case. I hope the very latest snapshot does the job.
On Tue, Jun 10, 2025 at 4:32 PM Y 2wt <yann.dethezy@gmail.com> wrote:
Yes, I missed that point, sorry.Nevertheless, I still encounter the problem with my xquery and data described before.I read "basex 12.0 beta c94e36c" on the gui windows header.Best,YannLe mar. 10 juin 2025, 15:27, Christian Grün <christian.gruen@gmail.com> a écrit :Java 17 is required for version 12; maybe that’s the problem?Otherwise, you can try to start the GUI on command line and check the error output.Y 2wt <yann.dethezy@gmail.com> schrieb am Di., 10. Juni 2025, 15:21:Hi Christian,thanks for the quick fix!I can't get the latest version gui to test (nothing appears after launching).I will try with a further latest.Best,YannLe mar. 10 juin 2025, 13:57, Christian Grün <christian.gruen@gmail.com> a écrit :Hi Yann,the bug has been fixed; a new snapshot is available [1].Best,ChristianOn Wed, Jun 4, 2025 at 1:39 PM Yann de Thézy <yann.dethezy@gmail.com> wrote:Hello,
I encounter what seems to be a bug with the use of Full Text Index (basex 11.9).
I have created a database with FTINDEX (and CASESENS + DIACRITICS).
When I call once a function in the xquery below, the result is different than when I call it twice.
It seems that the whole database is searched in the case of 2 calls which is not what is expected.
Xquery is :
declare function local:getHit($documents, $word) {
(# db:enforceindex #) {
$documents//*[text() contains text {$word}]
}
};
let $docs := collection()
let $docsSmall := for $doc in $docs where $doc/book/@category='COOKING' return $doc
let $a := trace("res 1 : " || count(local:getHit($docsSmall, '2005')))
(: uncomment the line below to change getHit result :)
(: let $a := trace("res 2 : " || count(local:getHit($docsSmall, '2005'))) :)
return ''
Result is :
"res 1 : 1"
After uncommenting the second call, result is:
"res 1 : 2"
"res 2 : 2"
The same with this more simple xquery:
declare function local:getHit($documents, $word) {
(# db:enforceindex #) {
$documents//*[text() contains text {$word}]
}
};
let $docs := collection()
let $docsSmall := $docs[1]
let $a := trace("res 1 : " || count(local:getHit($docsSmall, '2005')))
return ''
Result is :
"res 1 : 2"
("res 1 : 1" expected)
2 documents are populating this database :
<book category="COOKING">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
and
<book category="CHILDREN">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
Best,
Yann