From: Adam R. <ad...@ex...> - 2018-10-08 19:45:21
|
Hi Stanislav, I didn't implement the Lucene index in eXist-db, that would have been Wolfgang Meier. However to try and help you, I just studied that code. It looks to me that the LuceneIndexTest#checkIndex function scans over the entire index, capturing each occurence of one or more provided QNames in the `qn` parameter and then returns the total number of occurrences. Hope that is helpful? On Mon, 8 Oct 2018 at 16:51, Stanislav <st...@gm...> wrote: > Ok, > may be this is asking for too much. > How about something simpler then -- could someone please add meaningful > documentation to the > > private Occurrences[] checkIndex(final DocumentSet docs, final DBBroker broker, final QName[] qn, final String term, final int expected) > > method in extensions/indexes/lucene/test/src/org/exist/indexing/lucene/LuceneIndexTest.java ? > > /St. > > > On Fri, Oct 5, 2018 at 5:22 PM Stanislav <st...@gm...> wrote: > >> Ok, >> >> I've crafted a basic test case and it does not work (not sure if it is >> the test that is wrong or the code tested that is wrong) >> Could someone knowledgeable in LuceneIndexTest(s) take a look at the test >> that I just added and tell me why it fails: >> >> >> https://github.com/eXist-db/exist/pull/2169/commits/39896b258b34571e4e264c46e4759b6ed14292ce >> >> /St. >> >> On Thu, Oct 4, 2018 at 6:43 PM Stanislav <st...@gm...> wrote: >> >>> Exactly - as Dom has explained it. >>> (Excuse me for not making myself clearer) >>> >>> /Stanislav >>> >>> On Thu, 4 Oct 2018 at 12:43, Dominic Latham <dom...@gm...> >>> wrote: >>> >>>> Dear Adam, >>>> >>>> Thanks for your help. >>>> >>>> The comments in the TEI express the tests >>>> e.g. >>>> <!-- this should get indexed --> >>>> <!-- this should not get indexed -- attribute name ns does not match --> >>>> >>>> I think the question is how to express that as a test in exist i.e. >>>> that a particular text node has been indexed. >>>> Does that make sense? >>>> >>>> With best wishes, >>>> >>>> Dominic >>>> >>>> >>>> >>>> >>>> On Wed, 3 Oct 2018 at 09:43, Adam Retter <ad...@ex...> wrote: >>>> >>>>> >>>>> Erm... you don't say what you are trying to test exactly? >>>>> >>>>> On Wed, 3 Oct 2018 at 12:59, Stanislav <st...@gm...> wrote: >>>>> >>>>>> Hi guys, >>>>>> >>>>>> A test case is required for the code that implements: >>>>>> "Allow more elaborate XPath expressions in the Lucene index spec in >>>>>> collection.xconf" (#2169) >>>>>> >>>>>> and I have trouble understanding how existing indexing tests do work >>>>>> (and I am a bit tired of reverse-engineering) >>>>>> It would be great if someone familiar with the matter could give me a >>>>>> hand here: >>>>>> >>>>>> *The collection.xconf should be like this:* >>>>>> <collection xmlns="http://exist-db.org/collection-config/1.0"> >>>>>> <index xmlns:tei="http://www.tei-c.org/ns/1.0"> >>>>>> <!-- Lucene indexes --> >>>>>> <lucene diacritics="no"> >>>>>> <analyzer >>>>>> class="org.apache.lucene.analysis.standard.StandardAnalyzer"/> >>>>>> <text field="title" >>>>>> match="//tei:title[@xml:lang='Sa-Ltn']" boost="2.0"/> >>>>>> </lucene> >>>>>> </index> >>>>>> </collection> >>>>>> >>>>>> *While the document being indexed should be like this:* >>>>>> <?xml-model href="../schema/1.0/tei.rng" schematypens=" >>>>>> http://relaxng.org/ns/structure/1.0"?> >>>>>> <TEI xmlns="http://www.tei-c.org/ns/1.0"> >>>>>> <teiHeader> >>>>>> <title type="longTitle" xml:lang="Sa-Ltn">Buick</title> <!-- >>>>>> this should get indexed --> >>>>>> <title type="longTitle" lang="Sa-Ltn">Cadillac</title> >>>>>> <!-- this should not get indexed -- attribute name ns does not match --> >>>>>> <title type="longTitle" xml:lang="En"> Ford</title> <!-- >>>>>> this should not get indexed -- attribute value does not match --> >>>>>> <title type="longTitle"> Dodge >>>>>> </title> <!-- this should not get indexed -- attribute is entirely missing >>>>>> --> >>>>>> </teiHeader> >>>>>> </TEI> >>>>>> >>>>>> >>>>>> Kind regards, >>>>>> /St. >>>>>> >>>>>> _______________________________________________ >>>>>> Exist-development mailing list >>>>>> Exi...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/exist-development >>>>>> >>>>> >>>>> >>>>> -- >>>>> Adam Retter >>>>> >>>>> eXist Core Developer >>>>> { United Kingdom / United States } >>>>> ad...@ex... >>>>> >>>> _______________________________________________ >>>>> Exist-open mailing list >>>>> Exi...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/exist-open >>>>> >>>> _______________________________________________ > Exist-development mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-development > -- Adam Retter eXist Core Developer { United Kingdom / United States } ad...@ex... |