Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util:expand($result) has no exist:match elements #2755

Open
domlatham opened this issue May 27, 2019 · 2 comments
Open

util:expand($result) has no exist:match elements #2755

domlatham opened this issue May 27, 2019 · 2 comments
Labels
bug issue confirmed as bug Lucene issue is related to Lucene or its integration

Comments

@domlatham
Copy link

domlatham commented May 27, 2019

What is the problem

util:expand($result) has no exist:match elements

What did you expect

$result to have at least one exist:match elements

Describe how to reproduce or add a test

The following test fails as no exist:match nodes are found in the util:expand($result)
However you can remove the line of configuration from collection.xconf marked <!-- remove to pass the test --> and it will pass the test.
This indicates that the order of the nodes in the collection.xconf configuration impacts on the result of util:expand(). Presumably this is not as it should be?

xquery version "3.1";

module namespace eftt="http://exist-db.org/xquery/lucene/eft/test";

declare namespace eft="http://read.84000.co/ns/1.0";
declare namespace test="http://exist-db.org/xquery/xqsuite";

declare variable $eftt:test :=
    <test xmlns="http://read.84000.co/ns/1.0">
        <phrase>All phenomena are devoid of independent existence</phrase>
    </test>;

declare variable $eftt:xconf :=
    <collection xmlns="http://exist-db.org/collection-config/1.0">
        <index xmlns:eft="http://read.84000.co/ns/1.0">
            <lucene>
                <analyzer id="st" class="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
                <analyzer id="ws" class="org.apache.lucene.analysis.core.WhitespaceAnalyzer"/>
                <text match="//eft:phrase" analyzer="st" field="phrase-st"/><!-- remove to pass the test -->
                <text match="//eft:phrase" analyzer="ws" field="phrase-ws"/>
            </lucene>
        </index>
    </collection>;

declare %test:setUp function eftt:setup() {
    xmldb:create-collection("/db/system/config/db", "test"),
    xmldb:store("/db/system/config/db/test", "collection.xconf", $eftt:xconf),
    xmldb:create-collection("/db", "test"),
    xmldb:store("/db/test", "test.xml", $eftt:test)
};

declare %test:tearDown function eftt:teardown() {
    xmldb:remove("/db/test"),
    xmldb:remove("/db/system/config/db/test")
};

declare %test:assertExists function eftt:ft-result-contains-match() {
    let $test-data := collection('/db/test')
    for $result in $test-data//eft:phrase[ft:query-field('phrase-ws', 'of')]
    return
       util:expand($result)//exist:match
};

Context information

  • eXist-db version 4.6.1
  • java version "1.8.0_111"
  • Ubuntu 16.04
  • 64 bit
  • Installed from eXist-db-setup-4.6.1.jar
@triage-new-issues triage-new-issues bot added the triage issue needs to be investigated label May 27, 2019
@domlatham
Copy link
Author

Is there anything I can add to this to clarify?

@duncdrum duncdrum added the investigate issues being looked at label Jun 13, 2019
@triage-new-issues triage-new-issues bot removed the triage issue needs to be investigated label Jun 13, 2019
@duncdrum duncdrum added bug issue confirmed as bug and removed investigate issues being looked at labels Jun 13, 2019
@duncdrum
Copy link
Contributor

ok i can reproduce this with 5.0.0-RC8-SNAPSHOT
see #2781
two times the analyzers are involved in faulty output could be coincidence, but i doubt it.

@line-o line-o added the Lucene issue is related to Lucene or its integration label Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issue confirmed as bug Lucene issue is related to Lucene or its integration
Projects
None yet
Development

No branches or pull requests

3 participants