Basic query
Friday, 20 May 2011 · 36 messages · last reply 27 May 2011
WV
Wiard Vasen20 May 2011 09:22 #
Dear Christian, Andreas,
I have trouble querying the following text.
Could you have a look at it and show me how I can pose different queries on the file?
I would be grateful if you did!
Thanks in advance.
Kind regards,
Wiard
LK
Lukas Kircher20 May 2011 09:45 #
Hi Wiard,
being neither Christian nor Andreas, I nevertheless take a
shot :)
It's kinda hard to give a hint knowing that little about your case, but I think you problem might be related to
namespaces.
As the root element 'TEI' declares a namespace, all descendants lie in this namespace (unless they declare another one or are linked to a prefix).
Short example - if you want to query a letDesc element you have to specify the namespace it is linked to. Just declare the prefix at the beginning of your query.
*declare namespace ns = "http://www.vangoghletters.org/ns/";
//ns:letDesc*You can also use namespace wildcards to access nodes without a specific prefix, for example the 'fileDesc' element:
*//*:fileDesc
*Hope this helps you a little - don't hesitate to ask for more.
I also included a link to a short discussion [1]. I'm afraid I can't provide with a better tutorial about namespaces - it's a rare thing.
Regards,
Lukas
[1] http://www.stylusstudio.com/xquerytalk/200608/001654.html *
*
2011/5/20 Wiard Vasen <wiard.vasen at gmail.com>
Quoted text · Wiard Vasen · 22 lines
> Dear Christian, Andreas, > > I have trouble querying the following text. > Could you have a look at it and show me how I can pose different queries on > the file? > > I would be grateful if you did! > > Thanks in advance. > > Kind regards, > > Wiard > > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > >
LK
Lukas Kircher20 May 2011 10:40 #
No problem, your welcome. Please send all your answers to
the mailing list as well as other users might come across the same problems ...
Greetings,
Lukas
Quoted text · Wiard Vasen · 116 lines
On Fri, May 20, 2011 at 10:32 AM, Wiard Vasen <wiard.vasen at gmail.com> wrote: > By the way: A very interesting explanation you gave. > I used: > *declare namespace ns = "http://www.vangoghletters.org/ns/"; > //ns:letDesc* > *Now I understand how it works.* > *Thanks! > * > > 2011/5/20 Wiard Vasen <wiard.vasen at gmail.com> > >> Hi Lukas, >> >> *//*:fileDesc *works, and gives the whole content of the file back. >> Starting with the term fileDesc in 'brackets'. >> >> When I use //*:sourceDesc or note I get a bit the same result. >> >> But what if I want what is in the 'idno' ? <idno type="jlb">012</idno> >> >> Or : <vg:placeLet>London</vg:placeLet> >> >> How do I get these results? >> >> Thanks in advance. >> >> Regards, >> >> Wiard >> >> >> 2011/5/20 Wiard Vasen <wiard.vasen at gmail.com> >> >>> Hey Lucas, >>> >>> thanks a lot for your help! >>> I have a look at your example. >>> >>> Regards, >>> >>> Wiard >>> >>> >>> >>> 2011/5/20 Lukas Kircher <lukaskircher1 at googlemail.com> >>> >>>> Hi Wiard, >>>> >>>> >>>> being neither Christian nor Andreas, I nevertheless take a >>>> shot :) >>>> >>>> It's kinda hard to give a hint knowing that little about your >>>> case, but I think you problem might be related to >>>> namespaces. >>>> >>>> As the root element 'TEI' declares a namespace, all descendants >>>> lie in this namespace (unless they declare another one or are >>>> linked to a prefix). >>>> >>>> Short example - if you want to query a letDesc element you have >>>> to specify the namespace it is linked to. Just declare the prefix >>>> at the beginning of your query. >>>> >>>> *declare namespace ns = "http://www.vangoghletters.org/ns/"; >>>> //ns:letDesc >>>> >>>> *You can also use namespace wildcards to access nodes without >>>> a specific prefix, for example the 'fileDesc' element: >>>> >>>> *//*:fileDesc >>>> >>>> *Hope this helps you a little - don't hesitate to ask for more. >>>> >>>> I also included a link to a short discussion [1]. I'm afraid I can't >>>> provide with a better tutorial about namespaces - it's a rare thing. >>>> >>>> Regards, >>>> Lukas >>>> >>>> [1] http://www.stylusstudio.com/xquerytalk/200608/001654.html >>>> * >>>> >>>> >>>> >>>> >>>> >>>> * >>>> 2011/5/20 Wiard Vasen <wiard.vasen at gmail.com> >>>> >>>>> Dear Christian, Andreas, >>>>> >>>>> I have trouble querying the following text. >>>>> Could you have a look at it and show me how I can pose different >>>>> queries on the file? >>>>> >>>>> I would be grateful if you did! >>>>> >>>>> Thanks in advance. >>>>> >>>>> Kind regards, >>>>> >>>>> Wiard >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> BaseX-Talk mailing list >>>>> BaseX-Talk at mailman.uni-konstanz.de >>>>> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >>>>> >>>>> >>>> >>> >> >
LK
Lukas Kircher20 May 2011 10:45 #
Hi Wiard,
But what if I want what is in the 'idno' ? <idno type="jlb">012</idno>
Quoted text · Lukas Kircher · 1 line
>
Or : <vg:placeLet>London</vg:placeLet>
Quoted text · Lukas Kircher · 1 line
>
*
*This should work:*
declare namespace ns = "http://www.tei-c.org/ns/1.0";
//ns:idno*
... and this:
*declare namespace ns = "http://www.vangoghletters.org/ns/"; //ns:placeLet
*Concerning your last email I guess you already figured it out yourself, right? Otherwise, just let me know.
Have a nice day, regards,
Lukas
Quoted text · Wiard Vasen · 105 lines
On Fri, May 20, 2011 at 10:26 AM, Wiard Vasen <wiard.vasen at gmail.com> wrote: > Hi Lukas, > > *//*:fileDesc *works, and gives the whole content of the file back. > Starting with the term fileDesc in 'brackets'. > > When I use //*:sourceDesc or note I get a bit the same result. > > But what if I want what is in the 'idno' ? <idno type="jlb">012</idno> > > Or : <vg:placeLet>London</vg:placeLet> > > How do I get these results? > > Thanks in advance. > > Regards, > > Wiard > > > 2011/5/20 Wiard Vasen <wiard.vasen at gmail.com> > >> Hey Lucas, >> >> thanks a lot for your help! >> I have a look at your example. >> >> Regards, >> >> Wiard >> >> >> >> 2011/5/20 Lukas Kircher <lukaskircher1 at googlemail.com> >> >>> Hi Wiard, >>> >>> >>> being neither Christian nor Andreas, I nevertheless take a >>> shot :) >>> >>> It's kinda hard to give a hint knowing that little about your >>> case, but I think you problem might be related to >>> namespaces. >>> >>> As the root element 'TEI' declares a namespace, all descendants >>> lie in this namespace (unless they declare another one or are >>> linked to a prefix). >>> >>> Short example - if you want to query a letDesc element you have >>> to specify the namespace it is linked to. Just declare the prefix >>> at the beginning of your query. >>> >>> *declare namespace ns = "http://www.vangoghletters.org/ns/"; >>> //ns:letDesc >>> >>> *You can also use namespace wildcards to access nodes without >>> a specific prefix, for example the 'fileDesc' element: >>> >>> *//*:fileDesc >>> >>> *Hope this helps you a little - don't hesitate to ask for more. >>> >>> I also included a link to a short discussion [1]. I'm afraid I can't >>> provide with a better tutorial about namespaces - it's a rare thing. >>> >>> Regards, >>> Lukas >>> >>> [1] http://www.stylusstudio.com/xquerytalk/200608/001654.html >>> * >>> >>> >>> >>> >>> >>> * >>> 2011/5/20 Wiard Vasen <wiard.vasen at gmail.com> >>> >>>> Dear Christian, Andreas, >>>> >>>> I have trouble querying the following text. >>>> Could you have a look at it and show me how I can pose different queries >>>> on the file? >>>> >>>> I would be grateful if you did! >>>> >>>> Thanks in advance. >>>> >>>> Kind regards, >>>> >>>> Wiard >>>> >>>> >>>> >>>> _______________________________________________ >>>> BaseX-Talk mailing list >>>> BaseX-Talk at mailman.uni-konstanz.de >>>> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >>>> >>>> >>> >> >
WV
Wiard Vasen20 May 2011 11:01 #
Hi Lukas,
Thanks a lot for your help!
Regards,
Wiard
2011/5/20 Lukas Kircher <lukaskircher1 at googlemail.com>
Quoted text · Lukas Kircher · 135 lines
> Hi Wiard, > > > > But what if I want what is in the 'idno' ? <idno type="jlb">012</idno> >> > Or : <vg:placeLet>London</vg:placeLet> >> > * > * > This should work:* > declare namespace ns = "http://www.tei-c.org/ns/1.0"; > //ns:idno* > ... and this: > * > declare namespace ns = "http://www.vangoghletters.org/ns/"; > //ns:placeLet > > > *Concerning your last email I guess you already figured it out yourself, > right? Otherwise, just let me know. > > > Have a nice day, regards, > Lukas > > > > On Fri, May 20, 2011 at 10:26 AM, Wiard Vasen <wiard.vasen at gmail.com>wrote: > >> Hi Lukas, >> >> *//*:fileDesc *works, and gives the whole content of the file back. >> Starting with the term fileDesc in 'brackets'. >> >> When I use //*:sourceDesc or note I get a bit the same result. >> >> But what if I want what is in the 'idno' ? <idno type="jlb">012</idno> >> >> Or : <vg:placeLet>London</vg:placeLet> >> >> How do I get these results? >> >> Thanks in advance. >> >> Regards, >> >> Wiard >> >> >> 2011/5/20 Wiard Vasen <wiard.vasen at gmail.com> >> >>> Hey Lucas, >>> >>> thanks a lot for your help! >>> I have a look at your example. >>> >>> Regards, >>> >>> Wiard >>> >>> >>> >>> 2011/5/20 Lukas Kircher <lukaskircher1 at googlemail.com> >>> >>>> Hi Wiard, >>>> >>>> >>>> being neither Christian nor Andreas, I nevertheless take a >>>> shot :) >>>> >>>> It's kinda hard to give a hint knowing that little about your >>>> case, but I think you problem might be related to >>>> namespaces. >>>> >>>> As the root element 'TEI' declares a namespace, all descendants >>>> lie in this namespace (unless they declare another one or are >>>> linked to a prefix). >>>> >>>> Short example - if you want to query a letDesc element you have >>>> to specify the namespace it is linked to. Just declare the prefix >>>> at the beginning of your query. >>>> >>>> *declare namespace ns = "http://www.vangoghletters.org/ns/"; >>>> //ns:letDesc >>>> >>>> *You can also use namespace wildcards to access nodes without >>>> a specific prefix, for example the 'fileDesc' element: >>>> >>>> *//*:fileDesc >>>> >>>> *Hope this helps you a little - don't hesitate to ask for more. >>>> >>>> I also included a link to a short discussion [1]. I'm afraid I can't >>>> provide with a better tutorial about namespaces - it's a rare thing. >>>> >>>> Regards, >>>> Lukas >>>> >>>> [1] http://www.stylusstudio.com/xquerytalk/200608/001654.html >>>> * >>>> >>>> >>>> >>>> >>>> >>>> * >>>> 2011/5/20 Wiard Vasen <wiard.vasen at gmail.com> >>>> >>>>> Dear Christian, Andreas, >>>>> >>>>> I have trouble querying the following text. >>>>> Could you have a look at it and show me how I can pose different >>>>> queries on the file? >>>>> >>>>> I would be grateful if you did! >>>>> >>>>> Thanks in advance. >>>>> >>>>> Kind regards, >>>>> >>>>> Wiard >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> BaseX-Talk mailing list >>>>> BaseX-Talk at mailman.uni-konstanz.de >>>>> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >>>>> >>>>> >>>> >>> >> >
WV
Wiard Vasen20 May 2011 11:20 #
Hi Lukas,
Having a thousand xml-files of the Van Gogh Letters, I want to query them like this:
Given the letters from Arles, how many letters have the term 'Gauguin'? Or: Given the letters from Arles, how many letters have the term 'Gauguin AND Pissarro'?
I give you an earlier solution of Leonard from the BaseX mailing -list, which might be useful to you.
let $range := 1 to 640
for $doc in collection('brievenvangogh')
let $uri := base-uri($doc),
$num := substring($uri, string-length($uri) - 6, 3)
where $num castable as xs:integer
and xs:integer($num) = $range
return <document uri='{$uri}'>{
for $n score $s in $doc//*[text() contains text 'gauguin']
return <hit score='{$s}'>{ $n }</hit>
}</document>Can you see from the query, printed in blue, whether it gives the tf/idf score?
While making the database I checked the td/idf score in the full text search option.
Regards,
Wiard
2011/5/20 Wiard Vasen <wiard.vasen at gmail.com>
Quoted text · Wiard Vasen · 147 lines
> Hi Lukas, > > Thanks a lot for your help! > > Regards, > > Wiard > > > 2011/5/20 Lukas Kircher <lukaskircher1 at googlemail.com> > >> Hi Wiard, >> >> >> >> But what if I want what is in the 'idno' ? <idno type="jlb">012</idno> >>> >> Or : <vg:placeLet>London</vg:placeLet> >>> >> * >> * >> This should work:* >> declare namespace ns = "http://www.tei-c.org/ns/1.0"; >> //ns:idno* >> ... and this: >> * >> declare namespace ns = "http://www.vangoghletters.org/ns/"; >> //ns:placeLet >> >> >> *Concerning your last email I guess you already figured it out yourself, >> right? Otherwise, just let me know. >> >> >> Have a nice day, regards, >> Lukas >> >> >> >> On Fri, May 20, 2011 at 10:26 AM, Wiard Vasen <wiard.vasen at gmail.com>wrote: >> >>> Hi Lukas, >>> >>> *//*:fileDesc *works, and gives the whole content of the file back. >>> Starting with the term fileDesc in 'brackets'. >>> >>> When I use //*:sourceDesc or note I get a bit the same result. >>> >>> But what if I want what is in the 'idno' ? <idno type="jlb">012</idno> >>> >>> Or : <vg:placeLet>London</vg:placeLet> >>> >>> How do I get these results? >>> >>> Thanks in advance. >>> >>> Regards, >>> >>> Wiard >>> >>> >>> 2011/5/20 Wiard Vasen <wiard.vasen at gmail.com> >>> >>>> Hey Lucas, >>>> >>>> thanks a lot for your help! >>>> I have a look at your example. >>>> >>>> Regards, >>>> >>>> Wiard >>>> >>>> >>>> >>>> 2011/5/20 Lukas Kircher <lukaskircher1 at googlemail.com> >>>> >>>>> Hi Wiard, >>>>> >>>>> >>>>> being neither Christian nor Andreas, I nevertheless take a >>>>> shot :) >>>>> >>>>> It's kinda hard to give a hint knowing that little about your >>>>> case, but I think you problem might be related to >>>>> namespaces. >>>>> >>>>> As the root element 'TEI' declares a namespace, all descendants >>>>> lie in this namespace (unless they declare another one or are >>>>> linked to a prefix). >>>>> >>>>> Short example - if you want to query a letDesc element you have >>>>> to specify the namespace it is linked to. Just declare the prefix >>>>> at the beginning of your query. >>>>> >>>>> *declare namespace ns = "http://www.vangoghletters.org/ns/"; >>>>> //ns:letDesc >>>>> >>>>> *You can also use namespace wildcards to access nodes without >>>>> a specific prefix, for example the 'fileDesc' element: >>>>> >>>>> *//*:fileDesc >>>>> >>>>> *Hope this helps you a little - don't hesitate to ask for more. >>>>> >>>>> I also included a link to a short discussion [1]. I'm afraid I can't >>>>> provide with a better tutorial about namespaces - it's a rare thing. >>>>> >>>>> Regards, >>>>> Lukas >>>>> >>>>> [1] http://www.stylusstudio.com/xquerytalk/200608/001654.html >>>>> * >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> * >>>>> 2011/5/20 Wiard Vasen <wiard.vasen at gmail.com> >>>>> >>>>>> Dear Christian, Andreas, >>>>>> >>>>>> I have trouble querying the following text. >>>>>> Could you have a look at it and show me how I can pose different >>>>>> queries on the file? >>>>>> >>>>>> I would be grateful if you did! >>>>>> >>>>>> Thanks in advance. >>>>>> >>>>>> Kind regards, >>>>>> >>>>>> Wiard >>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> BaseX-Talk mailing list >>>>>> BaseX-Talk at mailman.uni-konstanz.de >>>>>> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >>>>>> >>>>>> >>>>> >>>> >>> >> >
CG
Christian Grün20 May 2011 13:16 #
Wiard,
Quoted text · Wiard Vasen · 3 lines
> Given the letters from Arles, how many letters have the term 'Gauguin'? > Or: Given the letters from Arles, how many letters have the term 'Gauguin > AND Pissarro'?
It depends on the input data. Did you manage to write a query that pre-selects the letters from Arles?
Quoted text · Wiard Vasen · 4 lines
> Can you see from the query, printed in blue, whether it gives the tf/idf > score? > While making the database I checked the td/idf score in the full text search > option.
You'll have to check the query info to see if the tf/idf scoring is used. If the compilation steps include sth like "Applying full-text index", you can be sure that tf/idf is used as scoring. Otherwise, the default scoring (..which often yields better results for XML documents..) is utilized.
Hope this helps,
Christian
WV
Wiard Vasen20 May 2011 13:54 #
Hi Lukas,
Yes. I have a query per-selecting te letters from Arles.
I do this by entering the numbers of the letters which are written in Arles. Letters in this range are from Arles.
let $range := 577 to 771
for $doc in collection('brievenvangogh')
let $uri := base-uri($doc),
$num := substring($uri, string-length($uri) - 6, 3)
where $num castable as xs:integer
and xs:integer($num) = $range
return <document uri='{$uri}'>{
for $n score $s in $doc//*[text() contains text 'gauguin']
return <hit score='{$s}'>{ $n }</hit>
}</document>I wonder if you see a query in this line of code which could do the required action:
for $n score $s in $doc//*[text() contains text 'gauguin']Something like: for $n score $s in $doc//*[text() contains text 'gauguin' AND contains text 'pissarro']
Regards,
Wiard
2011/5/20 Christian Grün <christian.gruen at gmail.com>
Quoted text · Christian Grün · 24 lines
> Wiard, > > > Given the letters from Arles, how many letters have the term 'Gauguin'? > > Or: Given the letters from Arles, how many letters have the term 'Gauguin > > AND Pissarro'? > > It depends on the input data. Did you manage to write a query that > pre-selects the letters from Arles? > > > Can you see from the query, printed in blue, whether it gives the tf/idf > > score? > > While making the database I checked the td/idf score in the full text > search > > option. > > You'll have to check the query info to see if the tf/idf scoring is > used. If the compilation steps include sth like "Applying full-text > index", you can be sure that tf/idf is used as scoring. Otherwise, the > default scoring (..which often yields better results for XML > documents..) is utilized. > > Hope this helps, > Christian >
CG
Christian Grün20 May 2011 14:04 #
Quoted text · Wiard Vasen · 2 lines
> Something like: for $n score $s in $doc//*[text() contains text 'gauguin' > AND contains text 'pissarro']
Looks fine; it should work if you switch "and" to lower case. You may also try:
for $n score $s in $doc//*[text() contains text 'gauguin' ftand 'pissarro']
for $n score $s in $doc//*[text() contains text { 'gauguin', 'pissarro' } all]Christian
WV
Wiard Vasen20 May 2011 14:35 #
Hi Christian,
It does work.
This is the one which works:
for $n score $s in $doc//*[text() contains text {'pissarro', 'gauguin'} ]
Thank you all for the help!
Regards,
Wiard
2011/5/20 Christian Grün <christian.gruen at gmail.com>
Quoted text · Christian Grün · 14 lines
> > Something like: for $n score $s in $doc//*[text() contains text 'gauguin' > > AND contains text 'pissarro'] > > Looks fine; it should work if you switch "and" to lower case. You may also > try: > > for $n score $s in $doc//*[text() contains text 'gauguin' ftand > 'pissarro'] > > for $n score $s in $doc//*[text() contains text { 'gauguin', 'pissarro' } > all] > > Christian >
CG
Christian Grün20 May 2011 15:22 #
Quoted text · Wiard Vasen · 2 lines
> This is the one which works: > for $n score $s in $doc//*[text() contains text {'pissarro', 'gauguin'} ]
Please note that the quoted query will either choose Pissarro or Gaugin; see e.g.:
"A" contains text { "A", "B" }
You'll have to append the "all" modifier to get sure that all artist names will be returned.
Christian
WV
Wiard Vasen20 May 2011 15:39 #
You are right. I was just investigating on this problem.
Though: for $n score $s in $doc//*[text() contains text
{'gauguin','pissarro','monet'}all ]
gives no text from the documents!?
And:
for $n score $s in $doc//*[text() contains text
{'gauguin','pissarro','monet'} ]
gives all the documents containing 'gauguin'.
I have tried this one: for $n score $s in $doc//*[text() contains text
{'gauguin',and,'pissarro',and,'cezanne'} all]
Doesn't work properly, either.Maybe you see a solution?
2011/5/20 Christian Grün <christian.gruen at gmail.com>
Quoted text · Christian Grün · 13 lines
> > This is the one which works: > > for $n score $s in $doc//*[text() contains text {'pissarro', 'gauguin'} ] > > Please note that the quoted query will either choose Pissarro or > Gaugin; see e.g.: > > "A" contains text { "A", "B" } > > You'll have to append the "all" modifier to get sure that all artist > names will be returned. > > Christian >
CG
Christian Grün20 May 2011 16:02 #
Quoted text · Wiard Vasen · 1 line
> $doc//*[text() contains text {'gauguin','pissarro','monet'}all ]
I would assume that none of the text nodes in your document contains all three names.
WV
Wiard Vasen20 May 2011 16:15 #
You are probably right.
That would be funny.
I am going to figure it out.
Regards.
2011/5/20 Christian Grün <christian.gruen at gmail.com>
Quoted text · Christian Grün · 5 lines
> > $doc//*[text() contains text {'gauguin','pissarro','monet'}all ] > > I would assume that none of the text nodes in your document contains > all three names. >
WV
Wiard Vasen20 May 2011 16:31 #
Hi Christian,
The query works.
Thanks a lot!
Regards,
Wiard
2011/5/20 Wiard Vasen <wiard.vasen at gmail.com>
Quoted text · Wiard Vasen · 16 lines
> You are probably right. > That would be funny. > > I am going to figure it out. > > Regards. > > 2011/5/20 Christian Grün <christian.gruen at gmail.com> > >> > $doc//*[text() contains text {'gauguin','pissarro','monet'}all ] >> >> I would assume that none of the text nodes in your document contains >> all three names. >> > >
WV
Wiard Vasen20 May 2011 17:05 #
Hi Christian,
I would like to make a counter for the number of documents containing the terms from the query.
I made one in blue in the following query.
let $range := 1 to 800
for $doc in collection('brievenvangogh')
let $uri := base-uri($doc),
$num := substring($uri, string-length($uri) - 6, 3)
where $num castable as xs:integer
and xs:integer($num) = $range
return <document uri='{$uri}'>{
let $t := 0
for $n score $s in $doc//*[text() contains text {'gauguin','pissarro'}all
]
return $t:=+1;
return <hit score='{$s}'>{$n}{$t} }</hit>
}
</document>Could you help me make this counter work?
Thank you in advance.
Regards,
Wiard
2011/5/20 Wiard Vasen <wiard.vasen at gmail.com>
Quoted text · Wiard Vasen · 28 lines
> Hi Christian, > > The query works. > Thanks a lot! > > Regards, > > Wiard > > 2011/5/20 Wiard Vasen <wiard.vasen at gmail.com> > >> You are probably right. >> That would be funny. >> >> I am going to figure it out. >> >> Regards. >> >> 2011/5/20 Christian Grün <christian.gruen at gmail.com> >> >>> > $doc//*[text() contains text {'gauguin','pissarro','monet'}all ] >>> >>> I would assume that none of the text nodes in your document contains >>> all three names. >>> >> >> >
CG
Christian Grün20 May 2011 17:12 #
XQuery is a functional language; as such, you can never update variables that have already been assigned. The count() function gives you the number of items in a sequence:
<hit score='{ $s }'>{ $n, count($n) }</hit>Quoted text · Wiard Vasen · 48 lines
On Fri, May 20, 2011 at 5:05 PM, Wiard Vasen <wiard.vasen at gmail.com> wrote: > Hi Christian, > I would like to make a counter for the number of documents containing the > terms from the query. > I made one in blue in the following query. > let $range := 1 to 800 > for $doc in collection('brievenvangogh') > let $uri := base-uri($doc), > $num := substring($uri, string-length($uri) - 6, 3) > where $num castable as xs:integer > and xs:integer($num) = $range > return <document uri='{$uri}'>{ > let $t := 0 > for $n score $s in $doc//*[text() contains text {'gauguin','pissarro'}all > ] > return $t:=+1; > return <hit score='{$s}'>{$n}{$t} }</hit> > } > </document> > Could you help me make this counter work? > Thank you in advance. > Regards, > Wiard > 2011/5/20 Wiard Vasen <wiard.vasen at gmail.com> >> >> Hi Christian, >> The query works. >> Thanks a lot! >> Regards, >> Wiard >> >> 2011/5/20 Wiard Vasen <wiard.vasen at gmail.com> >>> >>> You are probably right. >>> That would be funny. >>> I am going to figure it out. >>> Regards. >>> >>> 2011/5/20 Christian Grün <christian.gruen at gmail.com> >>>> >>>> > $doc//*[text() contains text {'gauguin','pissarro','monet'}all ] >>>> >>>> I would assume that none of the text nodes in your document contains >>>> all three names. >>> >> > >
WV
Wiard Vasen20 May 2011 18:43 #
Oke Christian,
I learned a lot from you.
Have a nice weekend.
Regards,
Wiard
2011/5/20 Christian Grün <christian.gruen at gmail.com>
Quoted text · Christian Grün · 58 lines
> XQuery is a functional language; as such, you can never update > variables that have already been assigned. The count() function gives > you the number of items in a sequence: > > <hit score='{ $s }'>{ $n, count($n) }</hit> > ___________________________ > > On Fri, May 20, 2011 at 5:05 PM, Wiard Vasen <wiard.vasen at gmail.com> > wrote: > > Hi Christian, > > I would like to make a counter for the number of documents containing the > > terms from the query. > > I made one in blue in the following query. > > let $range := 1 to 800 > > for $doc in collection('brievenvangogh') > > let $uri := base-uri($doc), > > $num := substring($uri, string-length($uri) - 6, 3) > > where $num castable as xs:integer > > and xs:integer($num) = $range > > return <document uri='{$uri}'>{ > > let $t := 0 > > for $n score $s in $doc//*[text() contains text > {'gauguin','pissarro'}all > > ] > > return $t:=+1; > > return <hit score='{$s}'>{$n}{$t} }</hit> > > } > > </document> > > Could you help me make this counter work? > > Thank you in advance. > > Regards, > > Wiard > > 2011/5/20 Wiard Vasen <wiard.vasen at gmail.com> > >> > >> Hi Christian, > >> The query works. > >> Thanks a lot! > >> Regards, > >> Wiard > >> > >> 2011/5/20 Wiard Vasen <wiard.vasen at gmail.com> > >>> > >>> You are probably right. > >>> That would be funny. > >>> I am going to figure it out. > >>> Regards. > >>> > >>> 2011/5/20 Christian Grün <christian.gruen at gmail.com> > >>>> > >>>> > $doc//*[text() contains text {'gauguin','pissarro','monet'}all ] > >>>> > >>>> I would assume that none of the text nodes in your document contains > >>>> all three names. > >>> > >> > > > > >
WV
Wiard Vasen22 May 2011 17:40 #
Hi Christian,
This weekend I tried to make a query which counts the number of times a certain combination of terms occurs in my repository of xml-files.
I didn't succeed in finding a way to count the number of occurrences. Could you help me with this?
I have attached the result-file from the query to this mail.
As you have said in your last mail, the found letters have to be put in a sequence. After that the items in the sequence have to be counted.
I was thinking of a method like:
let $sequence := ( a method to get the items from the result)
let $count := count($sequence)
return
<results>
<count>{$count}</count>
<items>
{for $item in $sequence
return
<item>{$item}</item>
}
</items>
</results>
let $range := 1 to 800
for $doc in collection('brievenvangogh')
let $uri := base-uri($doc),
$num := substring($uri, string-length($uri) - 6, 3)
where $num castable as xs:integer
and xs:integer($num) = $range
return <document uri='{$uri}'>{
for $n score $s in $doc//*[text() contains text {'gauguin','pissarro'}all
]
return <hit score='{ $s }'>{ $n, count($n) }</hit>
}
</document>In my count($n) I get only the number 1.
Thank you very much in advance!
Regards,
Wiard
2011/5/20 Wiard Vasen <wiard.vasen at gmail.com>
Quoted text · Wiard Vasen · 72 lines
> Oke Christian, > > I learned a lot from you. > Have a nice weekend. > > Regards, > > Wiard > > 2011/5/20 Christian Grün <christian.gruen at gmail.com> > >> XQuery is a functional language; as such, you can never update >> variables that have already been assigned. The count() function gives >> you the number of items in a sequence: >> >> <hit score='{ $s }'>{ $n, count($n) }</hit> >> ___________________________ >> >> On Fri, May 20, 2011 at 5:05 PM, Wiard Vasen <wiard.vasen at gmail.com> >> wrote: >> > Hi Christian, >> > I would like to make a counter for the number of documents >> containing the >> > terms from the query. >> > I made one in blue in the following query. >> > let $range := 1 to 800 >> > for $doc in collection('brievenvangogh') >> > let $uri := base-uri($doc), >> > $num := substring($uri, string-length($uri) - 6, 3) >> > where $num castable as xs:integer >> > and xs:integer($num) = $range >> > return <document uri='{$uri}'>{ >> > let $t := 0 >> > for $n score $s in $doc//*[text() contains text >> {'gauguin','pissarro'}all >> > ] >> > return $t:=+1; >> > return <hit score='{$s}'>{$n}{$t} }</hit> >> > } >> > </document> >> > Could you help me make this counter work? >> > Thank you in advance. >> > Regards, >> > Wiard >> > 2011/5/20 Wiard Vasen <wiard.vasen at gmail.com> >> >> >> >> Hi Christian, >> >> The query works. >> >> Thanks a lot! >> >> Regards, >> >> Wiard >> >> >> >> 2011/5/20 Wiard Vasen <wiard.vasen at gmail.com> >> >>> >> >>> You are probably right. >> >>> That would be funny. >> >>> I am going to figure it out. >> >>> Regards. >> >>> >> >>> 2011/5/20 Christian Grün <christian.gruen at gmail.com> >> >>>> >> >>>> > $doc//*[text() contains text {'gauguin','pissarro','monet'}all ] >> >>>> >> >>>> I would assume that none of the text nodes in your document contains >> >>>> all three names. >> >>> >> >> >> > >> > >> > >
CG
Christian Grün23 May 2011 00:32 #
Dear Wiard,
Quoted text · Wiard Vasen · 6 lines
> for $n score $s in $doc//*[text() contains text {'gauguin','pissarro'}all > ] > return <hit score='{ $s }'>{ $n, count($n) }</hit> > } > </document> > In my count($n) I get only the number 1.
true, that doesn't make sense. I'm sorry it's not possible (at least for now) to count the number of occurrences of search terms in a single hit. It could make sense, however, to extend our own set of full-text functions..
http://docs.basex.org/wiki/Full-Text_Functions
..with a new function that counts the number of full-text matches; something like:
ft:count ( $node[ . contains text { "a", "b" } ] )
Suggestions from everyone are welcome.
ChristianQuoted text · Wiard Vasen · 40 lines
On Sun, May 22, 2011 at 5:40 PM, Wiard Vasen <wiard.vasen at gmail.com> wrote: > Hi Christian, > This weekend I tried to make a query which counts the number of times a > certain combination of terms occurs in my repository of xml-files. > I didn't succeed in finding a way to count the number of occurrences. > Could you help me with this? > I have attached the result-file from the query to this mail. > As you have said in your last mail, the found letters have to be put in a > sequence. After that the items in the sequence have to be counted. > I was thinking of a method like: > let $sequence := ( a method to get the items from the result) > > let $count := count($sequence) > > return > <results> > <count>{$count}</count> > <items> > {for $item in $sequence > return > <item>{$item}</item> > } > </items> > </results> > > > > let $range := 1 to 800 > for $doc in collection('brievenvangogh') > let $uri := base-uri($doc), > $num := substring($uri, string-length($uri) - 6, 3) > where $num castable as xs:integer > and xs:integer($num) = $range > return <document uri='{$uri}'>{ > for $n score $s in $doc//*[text() contains text {'gauguin','pissarro'}all > ] > return <hit score='{ $s }'>{ $n, count($n) }</hit> > } > </document> > In my count($n) I get only the number 1.
CG
Christian Grün23 May 2011 00:47 #
Wiard,
Leo just gave me a hint that our
ft:mark() function can used as well to count the number of occurrences of terms in a full-text query. I hope that the following example gives you some clue: for $doc in doc('test')
let $terms := ('gauguin', 'pissarro')
for $hit score $s in $doc//*[text() contains text { $terms }]
let $c := count(ft:mark($hit[text() contains text { $terms }])/mark)
return <hit score="{ $s }" count="{ $c }">{ $hit }</hit>Note that, in this case, the contains text expression must be specified twice. Christian
Quoted text · Christian Grün · 68 lines
On Mon, May 23, 2011 at 12:32 AM, Christian Grün <christian.gruen at gmail.com> wrote: > Dear Wiard, > >> for $n score $s in $doc//*[text() contains text {'gauguin','pissarro'}all >> ] >> return <hit score='{ $s }'>{ $n, count($n) }</hit> >> } >> </document> >> In my count($n) I get only the number 1. > > true, that doesn't make sense. I'm sorry it's not possible (at least > for now) to count the number of occurrences of search terms in a > single hit. It could make sense, however, to extend our own set of > full-text functions.. > > http://docs.basex.org/wiki/Full-Text_Functions > > ..with a new function that counts the number of full-text matches; > something like: > > ft:count ( $node[ . contains text { "a", "b" } ] ) > > Suggestions from everyone are welcome. > Christian > _____________________ > > On Sun, May 22, 2011 at 5:40 PM, Wiard Vasen <wiard.vasen at gmail.com> wrote: >> Hi Christian, >> This weekend I tried to make a query which counts the number of times a >> certain combination of terms occurs in my repository of xml-files. >> I didn't succeed in finding a way to count the number of occurrences. >> Could you help me with this? >> I have attached the result-file from the query to this mail. >> As you have said in your last mail, the found letters have to be put in a >> sequence. After that the items in the sequence have to be counted. >> I was thinking of a method like: >> let $sequence := ( a method to get the items from the result) >> >> let $count := count($sequence) >> >> return >> <results> >> <count>{$count}</count> >> <items> >> {for $item in $sequence >> return >> <item>{$item}</item> >> } >> </items> >> </results> >> >> >> >> let $range := 1 to 800 >> for $doc in collection('brievenvangogh') >> let $uri := base-uri($doc), >> $num := substring($uri, string-length($uri) - 6, 3) >> where $num castable as xs:integer >> and xs:integer($num) = $range >> return <document uri='{$uri}'>{ >> for $n score $s in $doc//*[text() contains text {'gauguin','pissarro'}all >> ] >> return <hit score='{ $s }'>{ $n, count($n) }</hit> >> } >> </document> >> In my count($n) I get only the number 1. >
CG
Christian Grün23 May 2011 01:39 #
..and a last one: I'm glad to tell you that we've just added the
ft:count() function to our full-text module:
http://docs.basex.org/wiki/Full-Text_Functions#ft:count
Now you can either count the total number of occurrences of search terms in your documents: let $terms := ('gauguin', 'pissarro')
return ft:count( //*[text() contains text { $terms } ] )...or return them hit by hit as e.g. follows:
for $doc in doc('test')
let $terms := ('gauguin', 'pissarro')
for $hit score $s in $doc//*[text() contains text { $terms }]
let $c := ft:count($hit[text() contains text { $terms }])
return <hit score="{ $s }" count="{ $c }">{ $hit }</hit>Please download the latest snapshot of BaseX to get the new feature working:
http://files.basex.org/releases/latest/
Christian
Quoted text · Christian Grün · 87 lines
On Mon, May 23, 2011 at 12:47 AM, Christian Grün <christian.gruen at gmail.com> wrote: > Wiard, > > Leo just gave me a hint that our ft:mark() function can used as well > to count the number of occurrences of terms in a full-text query. I > hope that the following example gives you some clue: > > for $doc in doc('test') > let $terms := ('gauguin', 'pissarro') > for $hit score $s in $doc//*[text() contains text { $terms }] > let $c := count(ft:mark($hit[text() contains text { $terms }])/mark) > return <hit score="{ $s }" count="{ $c }">{ $hit }</hit> > > Note that, in this case, the contains text expression must be specified twice. > Christian > ___________________________ > > On Mon, May 23, 2011 at 12:32 AM, Christian Grün > <christian.gruen at gmail.com> wrote: >> Dear Wiard, >> >>> for $n score $s in $doc//*[text() contains text {'gauguin','pissarro'}all >>> ] >>> return <hit score='{ $s }'>{ $n, count($n) }</hit> >>> } >>> </document> >>> In my count($n) I get only the number 1. >> >> true, that doesn't make sense. I'm sorry it's not possible (at least >> for now) to count the number of occurrences of search terms in a >> single hit. It could make sense, however, to extend our own set of >> full-text functions.. >> >> http://docs.basex.org/wiki/Full-Text_Functions >> >> ..with a new function that counts the number of full-text matches; >> something like: >> >> ft:count ( $node[ . contains text { "a", "b" } ] ) >> >> Suggestions from everyone are welcome. >> Christian >> _____________________ >> >> On Sun, May 22, 2011 at 5:40 PM, Wiard Vasen <wiard.vasen at gmail.com> wrote: >>> Hi Christian, >>> This weekend I tried to make a query which counts the number of times a >>> certain combination of terms occurs in my repository of xml-files. >>> I didn't succeed in finding a way to count the number of occurrences. >>> Could you help me with this? >>> I have attached the result-file from the query to this mail. >>> As you have said in your last mail, the found letters have to be put in a >>> sequence. After that the items in the sequence have to be counted. >>> I was thinking of a method like: >>> let $sequence := ( a method to get the items from the result) >>> >>> let $count := count($sequence) >>> >>> return >>> <results> >>> <count>{$count}</count> >>> <items> >>> {for $item in $sequence >>> return >>> <item>{$item}</item> >>> } >>> </items> >>> </results> >>> >>> >>> >>> let $range := 1 to 800 >>> for $doc in collection('brievenvangogh') >>> let $uri := base-uri($doc), >>> $num := substring($uri, string-length($uri) - 6, 3) >>> where $num castable as xs:integer >>> and xs:integer($num) = $range >>> return <document uri='{$uri}'>{ >>> for $n score $s in $doc//*[text() contains text {'gauguin','pissarro'}all >>> ] >>> return <hit score='{ $s }'>{ $n, count($n) }</hit> >>> } >>> </document> >>> In my count($n) I get only the number 1. >> >
WV
Wiard Vasen23 May 2011 07:32 #
Hi Christian,
Thanks a lot for all your work.
That's really very kind of Leo and you!
This afternoon I will look at your solutions and come back to you.
Regards Wiard
2011/5/23 Christian Grün <christian.gruen at gmail.com>
Quoted text · Christian Grün · 120 lines
> ..and a last one: I'm glad to tell you that we've just added the > ft:count() function to our full-text module: > > http://docs.basex.org/wiki/Full-Text_Functions#ft:count > > Now you can either count the total number of occurrences of search > terms in your documents: > > let $terms := ('gauguin', 'pissarro') > return ft:count( //*[text() contains text { $terms } ] ) > > ...or return them hit by hit as e.g. follows: > > for $doc in doc('test') > let $terms := ('gauguin', 'pissarro') > for $hit score $s in $doc//*[text() contains text { $terms }] > let $c := ft:count($hit[text() contains text { $terms }]) > return <hit score="{ $s }" count="{ $c }">{ $hit }</hit> > > Please download the latest snapshot of BaseX to get the new feature > working: > > http://files.basex.org/releases/latest/ > > Christian > ___________________________ > > On Mon, May 23, 2011 at 12:47 AM, Christian Grün > <christian.gruen at gmail.com> wrote: > > Wiard, > > > > Leo just gave me a hint that our ft:mark() function can used as well > > to count the number of occurrences of terms in a full-text query. I > > hope that the following example gives you some clue: > > > > for $doc in doc('test') > > let $terms := ('gauguin', 'pissarro') > > for $hit score $s in $doc//*[text() contains text { $terms }] > > let $c := count(ft:mark($hit[text() contains text { $terms }])/mark) > > return <hit score="{ $s }" count="{ $c }">{ $hit }</hit> > > > > Note that, in this case, the contains text expression must be specified > twice. > > Christian > > ___________________________ > > > > On Mon, May 23, 2011 at 12:32 AM, Christian Grün > > <christian.gruen at gmail.com> wrote: > >> Dear Wiard, > >> > >>> for $n score $s in $doc//*[text() contains text > {'gauguin','pissarro'}all > >>> ] > >>> return <hit score='{ $s }'>{ $n, count($n) }</hit> > >>> } > >>> </document> > >>> In my count($n) I get only the number 1. > >> > >> true, that doesn't make sense. I'm sorry it's not possible (at least > >> for now) to count the number of occurrences of search terms in a > >> single hit. It could make sense, however, to extend our own set of > >> full-text functions.. > >> > >> http://docs.basex.org/wiki/Full-Text_Functions > >> > >> ..with a new function that counts the number of full-text matches; > >> something like: > >> > >> ft:count ( $node[ . contains text { "a", "b" } ] ) > >> > >> Suggestions from everyone are welcome. > >> Christian > >> _____________________ > >> > >> On Sun, May 22, 2011 at 5:40 PM, Wiard Vasen <wiard.vasen at gmail.com> > wrote: > >>> Hi Christian, > >>> This weekend I tried to make a query which counts the number of times a > >>> certain combination of terms occurs in my repository of xml-files. > >>> I didn't succeed in finding a way to count the number of occurrences. > >>> Could you help me with this? > >>> I have attached the result-file from the query to this mail. > >>> As you have said in your last mail, the found letters have to be put in > a > >>> sequence. After that the items in the sequence have to be counted. > >>> I was thinking of a method like: > >>> let $sequence := ( a method to get the items from the result) > >>> > >>> let $count := count($sequence) > >>> > >>> return > >>> <results> > >>> <count>{$count}</count> > >>> <items> > >>> {for $item in $sequence > >>> return > >>> <item>{$item}</item> > >>> } > >>> </items> > >>> </results> > >>> > >>> > >>> > >>> let $range := 1 to 800 > >>> for $doc in collection('brievenvangogh') > >>> let $uri := base-uri($doc), > >>> $num := substring($uri, string-length($uri) - 6, 3) > >>> where $num castable as xs:integer > >>> and xs:integer($num) = $range > >>> return <document uri='{$uri}'>{ > >>> for $n score $s in $doc//*[text() contains text > {'gauguin','pissarro'}all > >>> ] > >>> return <hit score='{ $s }'>{ $n, count($n) }</hit> > >>> } > >>> </document> > >>> In my count($n) I get only the number 1. > >> > > >
WV
Wiard Vasen23 May 2011 17:56 #
Hi Leo and Christian,
The number of hits is shown in the application itself.
This is very useful and I thank you very much for your help!
Till next time.
Regards,
Wiard
2011/5/23 Wiard Vasen <wiard.vasen at gmail.com>
Quoted text · Wiard Vasen · 133 lines
> Hi Christian, > > Thanks a lot for all your work. > That's really very kind of Leo and you! > This afternoon I will look at your solutions and come back to you. > > Regards Wiard > > 2011/5/23 Christian Grün <christian.gruen at gmail.com> > >> ..and a last one: I'm glad to tell you that we've just added the >> ft:count() function to our full-text module: >> >> http://docs.basex.org/wiki/Full-Text_Functions#ft:count >> >> Now you can either count the total number of occurrences of search >> terms in your documents: >> >> let $terms := ('gauguin', 'pissarro') >> return ft:count( //*[text() contains text { $terms } ] ) >> >> ...or return them hit by hit as e.g. follows: >> >> for $doc in doc('test') >> let $terms := ('gauguin', 'pissarro') >> for $hit score $s in $doc//*[text() contains text { $terms }] >> let $c := ft:count($hit[text() contains text { $terms }]) >> return <hit score="{ $s }" count="{ $c }">{ $hit }</hit> >> >> Please download the latest snapshot of BaseX to get the new feature >> working: >> >> http://files.basex.org/releases/latest/ >> >> Christian >> ___________________________ >> >> On Mon, May 23, 2011 at 12:47 AM, Christian Grün >> <christian.gruen at gmail.com> wrote: >> > Wiard, >> > >> > Leo just gave me a hint that our ft:mark() function can used as well >> > to count the number of occurrences of terms in a full-text query. I >> > hope that the following example gives you some clue: >> > >> > for $doc in doc('test') >> > let $terms := ('gauguin', 'pissarro') >> > for $hit score $s in $doc//*[text() contains text { $terms }] >> > let $c := count(ft:mark($hit[text() contains text { $terms }])/mark) >> > return <hit score="{ $s }" count="{ $c }">{ $hit }</hit> >> > >> > Note that, in this case, the contains text expression must be specified >> twice. >> > Christian >> > ___________________________ >> > >> > On Mon, May 23, 2011 at 12:32 AM, Christian Grün >> > <christian.gruen at gmail.com> wrote: >> >> Dear Wiard, >> >> >> >>> for $n score $s in $doc//*[text() contains text >> {'gauguin','pissarro'}all >> >>> ] >> >>> return <hit score='{ $s }'>{ $n, count($n) }</hit> >> >>> } >> >>> </document> >> >>> In my count($n) I get only the number 1. >> >> >> >> true, that doesn't make sense. I'm sorry it's not possible (at least >> >> for now) to count the number of occurrences of search terms in a >> >> single hit. It could make sense, however, to extend our own set of >> >> full-text functions.. >> >> >> >> http://docs.basex.org/wiki/Full-Text_Functions >> >> >> >> ..with a new function that counts the number of full-text matches; >> >> something like: >> >> >> >> ft:count ( $node[ . contains text { "a", "b" } ] ) >> >> >> >> Suggestions from everyone are welcome. >> >> Christian >> >> _____________________ >> >> >> >> On Sun, May 22, 2011 at 5:40 PM, Wiard Vasen <wiard.vasen at gmail.com> >> wrote: >> >>> Hi Christian, >> >>> This weekend I tried to make a query which counts the number of times >> a >> >>> certain combination of terms occurs in my repository of xml-files. >> >>> I didn't succeed in finding a way to count the number of occurrences. >> >>> Could you help me with this? >> >>> I have attached the result-file from the query to this mail. >> >>> As you have said in your last mail, the found letters have to be put >> in a >> >>> sequence. After that the items in the sequence have to be counted. >> >>> I was thinking of a method like: >> >>> let $sequence := ( a method to get the items from the result) >> >>> >> >>> let $count := count($sequence) >> >>> >> >>> return >> >>> <results> >> >>> <count>{$count}</count> >> >>> <items> >> >>> {for $item in $sequence >> >>> return >> >>> <item>{$item}</item> >> >>> } >> >>> </items> >> >>> </results> >> >>> >> >>> >> >>> >> >>> let $range := 1 to 800 >> >>> for $doc in collection('brievenvangogh') >> >>> let $uri := base-uri($doc), >> >>> $num := substring($uri, string-length($uri) - 6, 3) >> >>> where $num castable as xs:integer >> >>> and xs:integer($num) = $range >> >>> return <document uri='{$uri}'>{ >> >>> for $n score $s in $doc//*[text() contains text >> {'gauguin','pissarro'}all >> >>> ] >> >>> return <hit score='{ $s }'>{ $n, count($n) }</hit> >> >>> } >> >>> </document> >> >>> In my count($n) I get only the number 1. >> >> >> > >> > >
WV
Wiard Vasen25 May 2011 12:56 #
Hi Christian, Leo,
Here is my query again.
let $range := 1 to 800
for $doc in collection('brievenvangogh')
let $uri := base-uri($doc),
$num := substring($uri, string-length($uri) - 6, 3)
where $num castable as xs:integer
and xs:integer($num) = $range
return <document uri='{$uri}'>{
let $terms := ('zonnebloemen')
for $hit score $s in $doc//*[text() contains text { $terms }]
let $c := ft:count($hit[text() contains text { $terms }])
return <hit score="{ $s }" count="{ $c }">{ $hit }</hit>
}
</document>I get the number of all documents as the number of hits.
And what I want is the number of documents containing the term 'zonnebloemen'.
Last time you had a solution for the number of hits in one specific document.
I hope you have a solution for this problem.
Thanks in advance!
Regrads,
Wiard
2011/5/23 Wiard Vasen <wiard.vasen at gmail.com>
Quoted text · Wiard Vasen · 148 lines
> Hi Leo and Christian, > > The number of hits is shown in the application itself. > This is very useful and I thank you very much for your help! > > Till next time. > > Regards, > > Wiard > > > 2011/5/23 Wiard Vasen <wiard.vasen at gmail.com> > >> Hi Christian, >> >> Thanks a lot for all your work. >> That's really very kind of Leo and you! >> This afternoon I will look at your solutions and come back to you. >> >> Regards Wiard >> >> 2011/5/23 Christian Grün <christian.gruen at gmail.com> >> >>> ..and a last one: I'm glad to tell you that we've just added the >>> ft:count() function to our full-text module: >>> >>> http://docs.basex.org/wiki/Full-Text_Functions#ft:count >>> >>> Now you can either count the total number of occurrences of search >>> terms in your documents: >>> >>> let $terms := ('gauguin', 'pissarro') >>> return ft:count( //*[text() contains text { $terms } ] ) >>> >>> ...or return them hit by hit as e.g. follows: >>> >>> for $doc in doc('test') >>> let $terms := ('gauguin', 'pissarro') >>> for $hit score $s in $doc//*[text() contains text { $terms }] >>> let $c := ft:count($hit[text() contains text { $terms }]) >>> return <hit score="{ $s }" count="{ $c }">{ $hit }</hit> >>> >>> Please download the latest snapshot of BaseX to get the new feature >>> working: >>> >>> http://files.basex.org/releases/latest/ >>> >>> Christian >>> ___________________________ >>> >>> On Mon, May 23, 2011 at 12:47 AM, Christian Grün >>> <christian.gruen at gmail.com> wrote: >>> > Wiard, >>> > >>> > Leo just gave me a hint that our ft:mark() function can used as well >>> > to count the number of occurrences of terms in a full-text query. I >>> > hope that the following example gives you some clue: >>> > >>> > for $doc in doc('test') >>> > let $terms := ('gauguin', 'pissarro') >>> > for $hit score $s in $doc//*[text() contains text { $terms }] >>> > let $c := count(ft:mark($hit[text() contains text { $terms }])/mark) >>> > return <hit score="{ $s }" count="{ $c }">{ $hit }</hit> >>> > >>> > Note that, in this case, the contains text expression must be specified >>> twice. >>> > Christian >>> > ___________________________ >>> > >>> > On Mon, May 23, 2011 at 12:32 AM, Christian Grün >>> > <christian.gruen at gmail.com> wrote: >>> >> Dear Wiard, >>> >> >>> >>> for $n score $s in $doc//*[text() contains text >>> {'gauguin','pissarro'}all >>> >>> ] >>> >>> return <hit score='{ $s }'>{ $n, count($n) }</hit> >>> >>> } >>> >>> </document> >>> >>> In my count($n) I get only the number 1. >>> >> >>> >> true, that doesn't make sense. I'm sorry it's not possible (at least >>> >> for now) to count the number of occurrences of search terms in a >>> >> single hit. It could make sense, however, to extend our own set of >>> >> full-text functions.. >>> >> >>> >> http://docs.basex.org/wiki/Full-Text_Functions >>> >> >>> >> ..with a new function that counts the number of full-text matches; >>> >> something like: >>> >> >>> >> ft:count ( $node[ . contains text { "a", "b" } ] ) >>> >> >>> >> Suggestions from everyone are welcome. >>> >> Christian >>> >> _____________________ >>> >> >>> >> On Sun, May 22, 2011 at 5:40 PM, Wiard Vasen <wiard.vasen at gmail.com> >>> wrote: >>> >>> Hi Christian, >>> >>> This weekend I tried to make a query which counts the number of times >>> a >>> >>> certain combination of terms occurs in my repository of xml-files. >>> >>> I didn't succeed in finding a way to count the number of occurrences. >>> >>> Could you help me with this? >>> >>> I have attached the result-file from the query to this mail. >>> >>> As you have said in your last mail, the found letters have to be put >>> in a >>> >>> sequence. After that the items in the sequence have to be counted. >>> >>> I was thinking of a method like: >>> >>> let $sequence := ( a method to get the items from the result) >>> >>> >>> >>> let $count := count($sequence) >>> >>> >>> >>> return >>> >>> <results> >>> >>> <count>{$count}</count> >>> >>> <items> >>> >>> {for $item in $sequence >>> >>> return >>> >>> <item>{$item}</item> >>> >>> } >>> >>> </items> >>> >>> </results> >>> >>> >>> >>> >>> >>> >>> >>> let $range := 1 to 800 >>> >>> for $doc in collection('brievenvangogh') >>> >>> let $uri := base-uri($doc), >>> >>> $num := substring($uri, string-length($uri) - 6, 3) >>> >>> where $num castable as xs:integer >>> >>> and xs:integer($num) = $range >>> >>> return <document uri='{$uri}'>{ >>> >>> for $n score $s in $doc//*[text() contains text >>> {'gauguin','pissarro'}all >>> >>> ] >>> >>> return <hit score='{ $s }'>{ $n, count($n) }</hit> >>> >>> } >>> >>> </document> >>> >>> In my count($n) I get only the number 1. >>> >> >>> > >>> >> >> >
CG
Christian Grün25 May 2011 12:59 #
Hi Wiard,
Quoted text · Wiard Vasen · 6 lines
> I get the number of all documents as the number of hits. > And what I want is the number of documents containing the term > 'zonnebloemen'. > Last time you had a solution for the number of hits in one specific > document. > I hope you have a solution for this problem.
Could you provide us with a little document that allows us to reproduce the problem?
Thanks,
Christian
WV
Wiard Vasen25 May 2011 13:06 #
Hi Christian,
I hereby send you several xml-files containing the term 'zonnebloemen'. The first four documents(266,653,667,740) are with this term. The last four(1,2,3,4) don't have the term.
Thanks for looking at my problem!
Regards,
Wiard
2011/5/25 Christian Grün <christian.gruen at gmail.com>
Quoted text · Christian Grün · 15 lines
> Hi Wiard, > > > I get the number of all documents as the number of hits. > > And what I want is the number of documents containing the term > > 'zonnebloemen'. > > Last time you had a solution for the number of hits in one specific > > document. > > I hope you have a solution for this problem. > > Could you provide us with a little document that allows us to > reproduce the problem? > > Thanks, > Christian >
WV
Wiard Vasen25 May 2011 20:56 #
Hi Christian,
Did I throw to much over the fence?
Regards,
Wiard
2011/5/25 Wiard Vasen <wiard.vasen at gmail.com>
Quoted text · Wiard Vasen · 32 lines
> Hi Christian, > > I hereby send you several xml-files containing the term 'zonnebloemen'. > The first four documents(266,653,667,740) are with this term. > The last four(1,2,3,4) don't have the term. > > Thanks for looking at my problem! > > Regards, > > Wiard > > > 2011/5/25 Christian Grün <christian.gruen at gmail.com> > >> Hi Wiard, >> >> > I get the number of all documents as the number of hits. >> > And what I want is the number of documents containing the term >> > 'zonnebloemen'. >> > Last time you had a solution for the number of hits in one specific >> > document. >> > I hope you have a solution for this problem. >> >> Could you provide us with a little document that allows us to >> reproduce the problem? >> >> Thanks, >> Christian >> > >
CG
Christian Grün25 May 2011 23:21 #
Hi Wiard,
sorry for the delay; my todo list is long today, but I'll try to give you some feedback soon (if not someone else is faster..).
Christian
Quoted text · Wiard Vasen · 35 lines
On Wed, May 25, 2011 at 8:56 PM, Wiard Vasen <wiard.vasen at gmail.com> wrote: > Hi Christian, > Did I throw to much over the fence? > Regards, > Wiard > > 2011/5/25 Wiard Vasen <wiard.vasen at gmail.com> >> >> Hi Christian, >> I hereby send you several xml-files containing the term 'zonnebloemen'. >> The first four documents(266,653,667,740) are with this term. >> The last four(1,2,3,4) don't have the term. >> Thanks for looking at my problem! >> Regards, >> Wiard >> >> 2011/5/25 Christian Grün <christian.gruen at gmail.com> >>> >>> Hi Wiard, >>> >>> > I get the number of all documents as the number of hits. >>> > And what I want is the number of documents containing the term >>> > 'zonnebloemen'. >>> > Last time you had a solution for the number of hits in one specific >>> > document. >>> > I hope you have a solution for this problem. >>> >>> Could you provide us with a little document that allows us to >>> reproduce the problem? >>> >>> Thanks, >>> Christian >> > >
WV
Wiard Vasen26 May 2011 08:00 #
Hi Christian,
Thank you for looking at the query. You are always a great help! The result I am looking for is the total number of occurences. Because there is such a large repository of letters.
With this number I am able to say that the word 'zonnebloemen' occurs 30 times in all documents. For example.
I thought this could be accomplished with a small alteration of this query.
If you see a solution that would be great, otherwise I just count them by hand.
Regards,
Wiard
2011/5/26 Christian Grün <christian.gruen at gmail.com>
Quoted text · Christian Grün · 96 lines
> Hi Wiard, > > finally a quick answer; the result seems correct to me, as the term > "zonnebloemen" occurs in three of the documents that you sent to me. > I've attached the result below; which result would you have expected? > > Christian > > > <document uri="file:/G:/XML/brievenvangogh/let001.xml"/> > <document uri="file:/G:/XML/brievenvangogh/let002.xml"/> > <document uri="file:/G:/XML/brievenvangogh/let003.xml"/> > <document uri="file:/G:/XML/brievenvangogh/let004.xml"/> > <document uri="file:/G:/XML/brievenvangogh/let266.xml"> > <hit score="0.2953945291203477" count="1"> > <ab xmlns="http://www.tei-c.org/ns/1.0" rend="indent">Verder > maakte ik nog een studie van een<lb n="28" xml:id="l-28"/>hofje met > een bleek & zonnebloemen.<anchor n="4" xml:id="note-o-4"/> > </ab> > </hit> > </document> > <document uri="file:/G:/XML/brievenvangogh/let653.xml"> > <hit score="0.2953945291203477" count="1"> > <ab xmlns="http://www.tei-c.org/ns/1.0" rend="indent">Ik heb een > studie van een tuin<c type="kk">/</c>haast een meter breed.<lb n="18" > xml:id="l-18"/>op den voorgrond klaprozen & andere roode bloemen > in groen.<lb n="19" xml:id="l-19"/>dan een vak<hi > rend="ital">blaauwe</hi>klokken<c type="kp">_</c>Dan een vak<lb n="20" > xml:id="l-20"/>oranje en geele afrikanen<c type="kk">/</c>dan witte en > geele<lb n="21" xml:id="l-21"/>bloemen en eindelijk op den achtergrond > rose en lilas<lb n="22" xml:id="l-22"/>en nog scabiosas<c > type="kk">/</c>donkerviolet<c type="kk">/</c>en roode geraniums en > zonnebloemen<lb n="23" xml:id="l-23"/>en een vijgeboom en laurier rose > en een wingerd<c type="kp">_</c>Aan ’t eind zwarte<lb n="24" > xml:id="l-24"/>cypressen tegen lage witte huisjes met oranje dak – en > een fijn<lb n="25" xml:id="l-25"/>groenblaauwe strook lucht.<anchor > n="1" xml:id="note-o-1"/> > </ab> > </hit> > </document> > <document uri="file:/G:/XML/brievenvangogh/let740.xml"> > <hit score="1" count="1"> > <hi xmlns="http://www.tei-c.org/ns/1.0" rend="ital">Zonnebloemen</hi> > </hit> > </document> > > > > On Wed, May 25, 2011 at 11:21 PM, Christian Grün > <christian.gruen at gmail.com> wrote: > > Hi Wiard, > > > > sorry for the delay; my todo list is long today, but I'll try to give > > you some feedback soon (if not someone else is faster..). > > > > Christian > > ___________________________ > > > > On Wed, May 25, 2011 at 8:56 PM, Wiard Vasen <wiard.vasen at gmail.com> > wrote: > >> Hi Christian, > >> Did I throw to much over the fence? > >> Regards, > >> Wiard > >> > >> 2011/5/25 Wiard Vasen <wiard.vasen at gmail.com> > >>> > >>> Hi Christian, > >>> I hereby send you several xml-files containing the term 'zonnebloemen'. > >>> The first four documents(266,653,667,740) are with this term. > >>> The last four(1,2,3,4) don't have the term. > >>> Thanks for looking at my problem! > >>> Regards, > >>> Wiard > >>> > >>> 2011/5/25 Christian Grün <christian.gruen at gmail.com> > >>>> > >>>> Hi Wiard, > >>>> > >>>> > I get the number of all documents as the number of hits. > >>>> > And what I want is the number of documents containing the term > >>>> > 'zonnebloemen'. > >>>> > Last time you had a solution for the number of hits in one specific > >>>> > document. > >>>> > I hope you have a solution for this problem. > >>>> > >>>> Could you provide us with a little document that allows us to > >>>> reproduce the problem? > >>>> > >>>> Thanks, > >>>> Christian > >>> > >> > >> > > >
CG
Christian Grün26 May 2011 14:55 #
Hi Wiard,
thanks for your answer. Just to get sure.. How should the result look like for the documents in question? ;)
Christian
Quoted text · Wiard Vasen · 114 lines
On Thu, May 26, 2011 at 8:00 AM, Wiard Vasen <wiard.vasen at gmail.com> wrote: > Hi Christian, > Thank you for looking at the query. You are always a great help! > The result I am looking for is the total number of occurences. > Because there is such a large repository of letters. > With this number I am able to say that the word 'zonnebloemen' occurs 30 > times in all documents. For example. > I thought this could be accomplished with a small alteration of this query. > If you see a solution that would be great, otherwise I just count them by > hand. > Regards, > Wiard > > > 2011/5/26 Christian Grün <christian.gruen at gmail.com> >> >> Hi Wiard, >> >> finally a quick answer; the result seems correct to me, as the term >> "zonnebloemen" occurs in three of the documents that you sent to me. >> I've attached the result below; which result would you have expected? >> >> Christian >> >> >> <document uri="file:/G:/XML/brievenvangogh/let001.xml"/> >> <document uri="file:/G:/XML/brievenvangogh/let002.xml"/> >> <document uri="file:/G:/XML/brievenvangogh/let003.xml"/> >> <document uri="file:/G:/XML/brievenvangogh/let004.xml"/> >> <document uri="file:/G:/XML/brievenvangogh/let266.xml"> >> <hit score="0.2953945291203477" count="1"> >> <ab xmlns="http://www.tei-c.org/ns/1.0" rend="indent">Verder >> maakte ik nog een studie van een<lb n="28" xml:id="l-28"/>hofje met >> een bleek & zonnebloemen.<anchor n="4" xml:id="note-o-4"/> >> </ab> >> </hit> >> </document> >> <document uri="file:/G:/XML/brievenvangogh/let653.xml"> >> <hit score="0.2953945291203477" count="1"> >> <ab xmlns="http://www.tei-c.org/ns/1.0" rend="indent">Ik heb een >> studie van een tuin<c type="kk">/</c>haast een meter breed.<lb n="18" >> xml:id="l-18"/>op den voorgrond klaprozen & andere roode bloemen >> in groen.<lb n="19" xml:id="l-19"/>dan een vak<hi >> rend="ital">blaauwe</hi>klokken<c type="kp">_</c>Dan een vak<lb n="20" >> xml:id="l-20"/>oranje en geele afrikanen<c type="kk">/</c>dan witte en >> geele<lb n="21" xml:id="l-21"/>bloemen en eindelijk op den achtergrond >> rose en lilas<lb n="22" xml:id="l-22"/>en nog scabiosas<c >> type="kk">/</c>donkerviolet<c type="kk">/</c>en roode geraniums en >> zonnebloemen<lb n="23" xml:id="l-23"/>en een vijgeboom en laurier rose >> en een wingerd<c type="kp">_</c>Aan ’t eind zwarte<lb n="24" >> xml:id="l-24"/>cypressen tegen lage witte huisjes met oranje dak – en >> een fijn<lb n="25" xml:id="l-25"/>groenblaauwe strook lucht.<anchor >> n="1" xml:id="note-o-1"/> >> </ab> >> </hit> >> </document> >> <document uri="file:/G:/XML/brievenvangogh/let740.xml"> >> <hit score="1" count="1"> >> <hi xmlns="http://www.tei-c.org/ns/1.0" rend="ital">Zonnebloemen</hi> >> </hit> >> </document> >> >> >> >> On Wed, May 25, 2011 at 11:21 PM, Christian Grün >> <christian.gruen at gmail.com> wrote: >> > Hi Wiard, >> > >> > sorry for the delay; my todo list is long today, but I'll try to give >> > you some feedback soon (if not someone else is faster..). >> > >> > Christian >> > ___________________________ >> > >> > On Wed, May 25, 2011 at 8:56 PM, Wiard Vasen <wiard.vasen at gmail.com> >> > wrote: >> >> Hi Christian, >> >> Did I throw to much over the fence? >> >> Regards, >> >> Wiard >> >> >> >> 2011/5/25 Wiard Vasen <wiard.vasen at gmail.com> >> >>> >> >>> Hi Christian, >> >>> I hereby send you several xml-files containing the term >> >>> 'zonnebloemen'. >> >>> The first four documents(266,653,667,740) are with this term. >> >>> The last four(1,2,3,4) don't have the term. >> >>> Thanks for looking at my problem! >> >>> Regards, >> >>> Wiard >> >>> >> >>> 2011/5/25 Christian Grün <christian.gruen at gmail.com> >> >>>> >> >>>> Hi Wiard, >> >>>> >> >>>> > I get the number of all documents as the number of hits. >> >>>> > And what I want is the number of documents containing the term >> >>>> > 'zonnebloemen'. >> >>>> > Last time you had a solution for the number of hits in one specific >> >>>> > document. >> >>>> > I hope you have a solution for this problem. >> >>>> >> >>>> Could you provide us with a little document that allows us to >> >>>> reproduce the problem? >> >>>> >> >>>> Thanks, >> >>>> Christian >> >>> >> >> >> >> >> > > >
WV
Wiard Vasen26 May 2011 17:10 #
Hi Christian,
The result should be: hits: 3.
In that case I can use the same query for all kind of terms. Like; how many occurrences are there in the repository of the term " gauguin", or "money".
That way I can both find the total number of occurrences as well as the files containing the term.
I hope this answers your question.
Regards,
Wiard
2011/5/26 Christian Grün <christian.gruen at gmail.com>
Quoted text · Christian Grün · 126 lines
> Hi Wiard, > > thanks for your answer. Just to get sure.. How should the result look > like for the documents in question? ;) > > Christian > > On Thu, May 26, 2011 at 8:00 AM, Wiard Vasen <wiard.vasen at gmail.com> > wrote: > > Hi Christian, > > Thank you for looking at the query. You are always a great help! > > The result I am looking for is the total number of occurences. > > Because there is such a large repository of letters. > > With this number I am able to say that the word 'zonnebloemen' occurs 30 > > times in all documents. For example. > > I thought this could be accomplished with a small alteration of this > query. > > If you see a solution that would be great, otherwise I just count them by > > hand. > > Regards, > > Wiard > > > > > > 2011/5/26 Christian Grün <christian.gruen at gmail.com> > >> > >> Hi Wiard, > >> > >> finally a quick answer; the result seems correct to me, as the term > >> "zonnebloemen" occurs in three of the documents that you sent to me. > >> I've attached the result below; which result would you have expected? > >> > >> Christian > >> > >> > >> <document uri="file:/G:/XML/brievenvangogh/let001.xml"/> > >> <document uri="file:/G:/XML/brievenvangogh/let002.xml"/> > >> <document uri="file:/G:/XML/brievenvangogh/let003.xml"/> > >> <document uri="file:/G:/XML/brievenvangogh/let004.xml"/> > >> <document uri="file:/G:/XML/brievenvangogh/let266.xml"> > >> <hit score="0.2953945291203477" count="1"> > >> <ab xmlns="http://www.tei-c.org/ns/1.0" rend="indent">Verder > >> maakte ik nog een studie van een<lb n="28" xml:id="l-28"/>hofje met > >> een bleek & zonnebloemen.<anchor n="4" xml:id="note-o-4"/> > >> </ab> > >> </hit> > >> </document> > >> <document uri="file:/G:/XML/brievenvangogh/let653.xml"> > >> <hit score="0.2953945291203477" count="1"> > >> <ab xmlns="http://www.tei-c.org/ns/1.0" rend="indent">Ik heb een > >> studie van een tuin<c type="kk">/</c>haast een meter breed.<lb n="18" > >> xml:id="l-18"/>op den voorgrond klaprozen & andere roode bloemen > >> in groen.<lb n="19" xml:id="l-19"/>dan een vak<hi > >> rend="ital">blaauwe</hi>klokken<c type="kp">_</c>Dan een vak<lb n="20" > >> xml:id="l-20"/>oranje en geele afrikanen<c type="kk">/</c>dan witte en > >> geele<lb n="21" xml:id="l-21"/>bloemen en eindelijk op den achtergrond > >> rose en lilas<lb n="22" xml:id="l-22"/>en nog scabiosas<c > >> type="kk">/</c>donkerviolet<c type="kk">/</c>en roode geraniums en > >> zonnebloemen<lb n="23" xml:id="l-23"/>en een vijgeboom en laurier rose > >> en een wingerd<c type="kp">_</c>Aan ’t eind zwarte<lb n="24" > >> xml:id="l-24"/>cypressen tegen lage witte huisjes met oranje dak – en > >> een fijn<lb n="25" xml:id="l-25"/>groenblaauwe strook lucht.<anchor > >> n="1" xml:id="note-o-1"/> > >> </ab> > >> </hit> > >> </document> > >> <document uri="file:/G:/XML/brievenvangogh/let740.xml"> > >> <hit score="1" count="1"> > >> <hi xmlns="http://www.tei-c.org/ns/1.0" > rend="ital">Zonnebloemen</hi> > >> </hit> > >> </document> > >> > >> > >> > >> On Wed, May 25, 2011 at 11:21 PM, Christian Grün > >> <christian.gruen at gmail.com> wrote: > >> > Hi Wiard, > >> > > >> > sorry for the delay; my todo list is long today, but I'll try to give > >> > you some feedback soon (if not someone else is faster..). > >> > > >> > Christian > >> > ___________________________ > >> > > >> > On Wed, May 25, 2011 at 8:56 PM, Wiard Vasen <wiard.vasen at gmail.com> > >> > wrote: > >> >> Hi Christian, > >> >> Did I throw to much over the fence? > >> >> Regards, > >> >> Wiard > >> >> > >> >> 2011/5/25 Wiard Vasen <wiard.vasen at gmail.com> > >> >>> > >> >>> Hi Christian, > >> >>> I hereby send you several xml-files containing the term > >> >>> 'zonnebloemen'. > >> >>> The first four documents(266,653,667,740) are with this term. > >> >>> The last four(1,2,3,4) don't have the term. > >> >>> Thanks for looking at my problem! > >> >>> Regards, > >> >>> Wiard > >> >>> > >> >>> 2011/5/25 Christian Grün <christian.gruen at gmail.com> > >> >>>> > >> >>>> Hi Wiard, > >> >>>> > >> >>>> > I get the number of all documents as the number of hits. > >> >>>> > And what I want is the number of documents containing the term > >> >>>> > 'zonnebloemen'. > >> >>>> > Last time you had a solution for the number of hits in one > specific > >> >>>> > document. > >> >>>> > I hope you have a solution for this problem. > >> >>>> > >> >>>> Could you provide us with a little document that allows us to > >> >>>> reproduce the problem? > >> >>>> > >> >>>> Thanks, > >> >>>> Christian > >> >>> > >> >> > >> >> > >> > > > > > >
WV
Wiard Vasen26 May 2011 18:58 #
Hi Christian,
The best would be that it's possible to enter more terms in the query. That way it will be possible for me to see in how many documents this combination of terms occur.
Regards,
Wiard
2011/5/26 Wiard Vasen <wiard.vasen at gmail.com>
Quoted text · Wiard Vasen · 150 lines
> Hi Christian, > > The result should be: hits: 3. > > In that case I can use the same query for all kind of terms. > Like; how many occurrences are there in the repository of the term " > gauguin", or "money". > > That way I can both find the total number of occurrences as well as the > files containing the term. > > I hope this answers your question. > > Regards, > > Wiard > > > > 2011/5/26 Christian Grün <christian.gruen at gmail.com> > >> Hi Wiard, >> >> thanks for your answer. Just to get sure.. How should the result look >> like for the documents in question? ;) >> >> Christian >> >> On Thu, May 26, 2011 at 8:00 AM, Wiard Vasen <wiard.vasen at gmail.com> >> wrote: >> > Hi Christian, >> > Thank you for looking at the query. You are always a great help! >> > The result I am looking for is the total number of occurences. >> > Because there is such a large repository of letters. >> > With this number I am able to say that the word 'zonnebloemen' occurs 30 >> > times in all documents. For example. >> > I thought this could be accomplished with a small alteration of this >> query. >> > If you see a solution that would be great, otherwise I just count them >> by >> > hand. >> > Regards, >> > Wiard >> > >> > >> > 2011/5/26 Christian Grün <christian.gruen at gmail.com> >> >> >> >> Hi Wiard, >> >> >> >> finally a quick answer; the result seems correct to me, as the term >> >> "zonnebloemen" occurs in three of the documents that you sent to me. >> >> I've attached the result below; which result would you have expected? >> >> >> >> Christian >> >> >> >> >> >> <document uri="file:/G:/XML/brievenvangogh/let001.xml"/> >> >> <document uri="file:/G:/XML/brievenvangogh/let002.xml"/> >> >> <document uri="file:/G:/XML/brievenvangogh/let003.xml"/> >> >> <document uri="file:/G:/XML/brievenvangogh/let004.xml"/> >> >> <document uri="file:/G:/XML/brievenvangogh/let266.xml"> >> >> <hit score="0.2953945291203477" count="1"> >> >> <ab xmlns="http://www.tei-c.org/ns/1.0" rend="indent">Verder >> >> maakte ik nog een studie van een<lb n="28" xml:id="l-28"/>hofje met >> >> een bleek & zonnebloemen.<anchor n="4" xml:id="note-o-4"/> >> >> </ab> >> >> </hit> >> >> </document> >> >> <document uri="file:/G:/XML/brievenvangogh/let653.xml"> >> >> <hit score="0.2953945291203477" count="1"> >> >> <ab xmlns="http://www.tei-c.org/ns/1.0" rend="indent">Ik heb een >> >> studie van een tuin<c type="kk">/</c>haast een meter breed.<lb n="18" >> >> xml:id="l-18"/>op den voorgrond klaprozen & andere roode bloemen >> >> in groen.<lb n="19" xml:id="l-19"/>dan een vak<hi >> >> rend="ital">blaauwe</hi>klokken<c type="kp">_</c>Dan een vak<lb n="20" >> >> xml:id="l-20"/>oranje en geele afrikanen<c type="kk">/</c>dan witte en >> >> geele<lb n="21" xml:id="l-21"/>bloemen en eindelijk op den achtergrond >> >> rose en lilas<lb n="22" xml:id="l-22"/>en nog scabiosas<c >> >> type="kk">/</c>donkerviolet<c type="kk">/</c>en roode geraniums en >> >> zonnebloemen<lb n="23" xml:id="l-23"/>en een vijgeboom en laurier rose >> >> en een wingerd<c type="kp">_</c>Aan ’t eind zwarte<lb n="24" >> >> xml:id="l-24"/>cypressen tegen lage witte huisjes met oranje dak – en >> >> een fijn<lb n="25" xml:id="l-25"/>groenblaauwe strook lucht.<anchor >> >> n="1" xml:id="note-o-1"/> >> >> </ab> >> >> </hit> >> >> </document> >> >> <document uri="file:/G:/XML/brievenvangogh/let740.xml"> >> >> <hit score="1" count="1"> >> >> <hi xmlns="http://www.tei-c.org/ns/1.0" >> rend="ital">Zonnebloemen</hi> >> >> </hit> >> >> </document> >> >> >> >> >> >> >> >> On Wed, May 25, 2011 at 11:21 PM, Christian Grün >> >> <christian.gruen at gmail.com> wrote: >> >> > Hi Wiard, >> >> > >> >> > sorry for the delay; my todo list is long today, but I'll try to give >> >> > you some feedback soon (if not someone else is faster..). >> >> > >> >> > Christian >> >> > ___________________________ >> >> > >> >> > On Wed, May 25, 2011 at 8:56 PM, Wiard Vasen <wiard.vasen at gmail.com> >> >> > wrote: >> >> >> Hi Christian, >> >> >> Did I throw to much over the fence? >> >> >> Regards, >> >> >> Wiard >> >> >> >> >> >> 2011/5/25 Wiard Vasen <wiard.vasen at gmail.com> >> >> >>> >> >> >>> Hi Christian, >> >> >>> I hereby send you several xml-files containing the term >> >> >>> 'zonnebloemen'. >> >> >>> The first four documents(266,653,667,740) are with this term. >> >> >>> The last four(1,2,3,4) don't have the term. >> >> >>> Thanks for looking at my problem! >> >> >>> Regards, >> >> >>> Wiard >> >> >>> >> >> >>> 2011/5/25 Christian Grün <christian.gruen at gmail.com> >> >> >>>> >> >> >>>> Hi Wiard, >> >> >>>> >> >> >>>> > I get the number of all documents as the number of hits. >> >> >>>> > And what I want is the number of documents containing the term >> >> >>>> > 'zonnebloemen'. >> >> >>>> > Last time you had a solution for the number of hits in one >> specific >> >> >>>> > document. >> >> >>>> > I hope you have a solution for this problem. >> >> >>>> >> >> >>>> Could you provide us with a little document that allows us to >> >> >>>> reproduce the problem? >> >> >>>> >> >> >>>> Thanks, >> >> >>>> Christian >> >> >>> >> >> >> >> >> >> >> >> > >> > >> > >> > >
CG
Hi Wiard,
the following query might give you the requested result:
ft:count ( db:open('brievenvangogh')//*[text() contains text 'zonnebloemen'] )
Hope this helps,
ChristianQuoted text · Wiard Vasen · 144 lines
On Thu, May 26, 2011 at 5:10 PM, Wiard Vasen <wiard.vasen at gmail.com> wrote: > Hi Christian, > The result should be: hits: 3. > In that case I can use the same query for all kind of terms. > Like; how many occurrences are there in the repository of the term " > gauguin", or "money". > That way I can both find the total number of occurrences as well as the > files containing the term. > I hope this answers your question. > Regards, > Wiard > > > > 2011/5/26 Christian Grün <christian.gruen at gmail.com> >> >> Hi Wiard, >> >> thanks for your answer. Just to get sure.. How should the result look >> like for the documents in question? ;) >> >> Christian >> >> On Thu, May 26, 2011 at 8:00 AM, Wiard Vasen <wiard.vasen at gmail.com> >> wrote: >> > Hi Christian, >> > Thank you for looking at the query. You are always a great help! >> > The result I am looking for is the total number of occurences. >> > Because there is such a large repository of letters. >> > With this number I am able to say that the word 'zonnebloemen' occurs 30 >> > times in all documents. For example. >> > I thought this could be accomplished with a small alteration of this >> > query. >> > If you see a solution that would be great, otherwise I just count them >> > by >> > hand. >> > Regards, >> > Wiard >> > >> > >> > 2011/5/26 Christian Grün <christian.gruen at gmail.com> >> >> >> >> Hi Wiard, >> >> >> >> finally a quick answer; the result seems correct to me, as the term >> >> "zonnebloemen" occurs in three of the documents that you sent to me. >> >> I've attached the result below; which result would you have expected? >> >> >> >> Christian >> >> >> >> >> >> <document uri="file:/G:/XML/brievenvangogh/let001.xml"/> >> >> <document uri="file:/G:/XML/brievenvangogh/let002.xml"/> >> >> <document uri="file:/G:/XML/brievenvangogh/let003.xml"/> >> >> <document uri="file:/G:/XML/brievenvangogh/let004.xml"/> >> >> <document uri="file:/G:/XML/brievenvangogh/let266.xml"> >> >> <hit score="0.2953945291203477" count="1"> >> >> <ab xmlns="http://www.tei-c.org/ns/1.0" rend="indent">Verder >> >> maakte ik nog een studie van een<lb n="28" xml:id="l-28"/>hofje met >> >> een bleek & zonnebloemen.<anchor n="4" xml:id="note-o-4"/> >> >> </ab> >> >> </hit> >> >> </document> >> >> <document uri="file:/G:/XML/brievenvangogh/let653.xml"> >> >> <hit score="0.2953945291203477" count="1"> >> >> <ab xmlns="http://www.tei-c.org/ns/1.0" rend="indent">Ik heb een >> >> studie van een tuin<c type="kk">/</c>haast een meter breed.<lb n="18" >> >> xml:id="l-18"/>op den voorgrond klaprozen & andere roode bloemen >> >> in groen.<lb n="19" xml:id="l-19"/>dan een vak<hi >> >> rend="ital">blaauwe</hi>klokken<c type="kp">_</c>Dan een vak<lb n="20" >> >> xml:id="l-20"/>oranje en geele afrikanen<c type="kk">/</c>dan witte en >> >> geele<lb n="21" xml:id="l-21"/>bloemen en eindelijk op den achtergrond >> >> rose en lilas<lb n="22" xml:id="l-22"/>en nog scabiosas<c >> >> type="kk">/</c>donkerviolet<c type="kk">/</c>en roode geraniums en >> >> zonnebloemen<lb n="23" xml:id="l-23"/>en een vijgeboom en laurier rose >> >> en een wingerd<c type="kp">_</c>Aan ’t eind zwarte<lb n="24" >> >> xml:id="l-24"/>cypressen tegen lage witte huisjes met oranje dak – en >> >> een fijn<lb n="25" xml:id="l-25"/>groenblaauwe strook lucht.<anchor >> >> n="1" xml:id="note-o-1"/> >> >> </ab> >> >> </hit> >> >> </document> >> >> <document uri="file:/G:/XML/brievenvangogh/let740.xml"> >> >> <hit score="1" count="1"> >> >> <hi xmlns="http://www.tei-c.org/ns/1.0" >> >> rend="ital">Zonnebloemen</hi> >> >> </hit> >> >> </document> >> >> >> >> >> >> >> >> On Wed, May 25, 2011 at 11:21 PM, Christian Grün >> >> <christian.gruen at gmail.com> wrote: >> >> > Hi Wiard, >> >> > >> >> > sorry for the delay; my todo list is long today, but I'll try to give >> >> > you some feedback soon (if not someone else is faster..). >> >> > >> >> > Christian >> >> > ___________________________ >> >> > >> >> > On Wed, May 25, 2011 at 8:56 PM, Wiard Vasen <wiard.vasen at gmail.com> >> >> > wrote: >> >> >> Hi Christian, >> >> >> Did I throw to much over the fence? >> >> >> Regards, >> >> >> Wiard >> >> >> >> >> >> 2011/5/25 Wiard Vasen <wiard.vasen at gmail.com> >> >> >>> >> >> >>> Hi Christian, >> >> >>> I hereby send you several xml-files containing the term >> >> >>> 'zonnebloemen'. >> >> >>> The first four documents(266,653,667,740) are with this term. >> >> >>> The last four(1,2,3,4) don't have the term. >> >> >>> Thanks for looking at my problem! >> >> >>> Regards, >> >> >>> Wiard >> >> >>> >> >> >>> 2011/5/25 Christian Grün <christian.gruen at gmail.com> >> >> >>>> >> >> >>>> Hi Wiard, >> >> >>>> >> >> >>>> > I get the number of all documents as the number of hits. >> >> >>>> > And what I want is the number of documents containing the term >> >> >>>> > 'zonnebloemen'. >> >> >>>> > Last time you had a solution for the number of hits in one >> >> >>>> > specific >> >> >>>> > document. >> >> >>>> > I hope you have a solution for this problem. >> >> >>>> >> >> >>>> Could you provide us with a little document that allows us to >> >> >>>> reproduce the problem? >> >> >>>> >> >> >>>> Thanks, >> >> >>>> Christian >> >> >>> >> >> >> >> >> >> >> >> > >> > >> > > >
WV
Wiard Vasen27 May 2011 08:36 #
Wow, exactly what I was looking for!
Thanks a lot Christian.
2011/5/26 Christian Grün <christian.gruen at gmail.com>
Quoted text · Christian Grün · 164 lines
> Hi Wiard, > > the following query might give you the requested result: > > ft:count ( db:open('brievenvangogh')//*[text() contains text > 'zonnebloemen'] ) > > Hope this helps, > Christian > ___________________________ > > On Thu, May 26, 2011 at 5:10 PM, Wiard Vasen <wiard.vasen at gmail.com> > wrote: > > Hi Christian, > > The result should be: hits: 3. > > In that case I can use the same query for all kind of terms. > > Like; how many occurrences are there in the repository of the term " > > gauguin", or "money". > > That way I can both find the total number of occurrences as well as the > > files containing the term. > > I hope this answers your question. > > Regards, > > Wiard > > > > > > > > 2011/5/26 Christian Grün <christian.gruen at gmail.com> > >> > >> Hi Wiard, > >> > >> thanks for your answer. Just to get sure.. How should the result look > >> like for the documents in question? ;) > >> > >> Christian > >> > >> On Thu, May 26, 2011 at 8:00 AM, Wiard Vasen <wiard.vasen at gmail.com> > >> wrote: > >> > Hi Christian, > >> > Thank you for looking at the query. You are always a great help! > >> > The result I am looking for is the total number of occurences. > >> > Because there is such a large repository of letters. > >> > With this number I am able to say that the word 'zonnebloemen' occurs > 30 > >> > times in all documents. For example. > >> > I thought this could be accomplished with a small alteration of this > >> > query. > >> > If you see a solution that would be great, otherwise I just count them > >> > by > >> > hand. > >> > Regards, > >> > Wiard > >> > > >> > > >> > 2011/5/26 Christian Grün <christian.gruen at gmail.com> > >> >> > >> >> Hi Wiard, > >> >> > >> >> finally a quick answer; the result seems correct to me, as the term > >> >> "zonnebloemen" occurs in three of the documents that you sent to me. > >> >> I've attached the result below; which result would you have expected? > >> >> > >> >> Christian > >> >> > >> >> > >> >> <document uri="file:/G:/XML/brievenvangogh/let001.xml"/> > >> >> <document uri="file:/G:/XML/brievenvangogh/let002.xml"/> > >> >> <document uri="file:/G:/XML/brievenvangogh/let003.xml"/> > >> >> <document uri="file:/G:/XML/brievenvangogh/let004.xml"/> > >> >> <document uri="file:/G:/XML/brievenvangogh/let266.xml"> > >> >> <hit score="0.2953945291203477" count="1"> > >> >> <ab xmlns="http://www.tei-c.org/ns/1.0" rend="indent">Verder > >> >> maakte ik nog een studie van een<lb n="28" xml:id="l-28"/>hofje met > >> >> een bleek & zonnebloemen.<anchor n="4" xml:id="note-o-4"/> > >> >> </ab> > >> >> </hit> > >> >> </document> > >> >> <document uri="file:/G:/XML/brievenvangogh/let653.xml"> > >> >> <hit score="0.2953945291203477" count="1"> > >> >> <ab xmlns="http://www.tei-c.org/ns/1.0" rend="indent">Ik heb een > >> >> studie van een tuin<c type="kk">/</c>haast een meter breed.<lb n="18" > >> >> xml:id="l-18"/>op den voorgrond klaprozen & andere roode bloemen > >> >> in groen.<lb n="19" xml:id="l-19"/>dan een vak<hi > >> >> rend="ital">blaauwe</hi>klokken<c type="kp">_</c>Dan een vak<lb > n="20" > >> >> xml:id="l-20"/>oranje en geele afrikanen<c type="kk">/</c>dan witte > en > >> >> geele<lb n="21" xml:id="l-21"/>bloemen en eindelijk op den > achtergrond > >> >> rose en lilas<lb n="22" xml:id="l-22"/>en nog scabiosas<c > >> >> type="kk">/</c>donkerviolet<c type="kk">/</c>en roode geraniums en > >> >> zonnebloemen<lb n="23" xml:id="l-23"/>en een vijgeboom en laurier > rose > >> >> en een wingerd<c type="kp">_</c>Aan ’t eind zwarte<lb n="24" > >> >> xml:id="l-24"/>cypressen tegen lage witte huisjes met oranje dak – en > >> >> een fijn<lb n="25" xml:id="l-25"/>groenblaauwe strook lucht.<anchor > >> >> n="1" xml:id="note-o-1"/> > >> >> </ab> > >> >> </hit> > >> >> </document> > >> >> <document uri="file:/G:/XML/brievenvangogh/let740.xml"> > >> >> <hit score="1" count="1"> > >> >> <hi xmlns="http://www.tei-c.org/ns/1.0" > >> >> rend="ital">Zonnebloemen</hi> > >> >> </hit> > >> >> </document> > >> >> > >> >> > >> >> > >> >> On Wed, May 25, 2011 at 11:21 PM, Christian Grün > >> >> <christian.gruen at gmail.com> wrote: > >> >> > Hi Wiard, > >> >> > > >> >> > sorry for the delay; my todo list is long today, but I'll try to > give > >> >> > you some feedback soon (if not someone else is faster..). > >> >> > > >> >> > Christian > >> >> > ___________________________ > >> >> > > >> >> > On Wed, May 25, 2011 at 8:56 PM, Wiard Vasen < > wiard.vasen at gmail.com> > >> >> > wrote: > >> >> >> Hi Christian, > >> >> >> Did I throw to much over the fence? > >> >> >> Regards, > >> >> >> Wiard > >> >> >> > >> >> >> 2011/5/25 Wiard Vasen <wiard.vasen at gmail.com> > >> >> >>> > >> >> >>> Hi Christian, > >> >> >>> I hereby send you several xml-files containing the term > >> >> >>> 'zonnebloemen'. > >> >> >>> The first four documents(266,653,667,740) are with this term. > >> >> >>> The last four(1,2,3,4) don't have the term. > >> >> >>> Thanks for looking at my problem! > >> >> >>> Regards, > >> >> >>> Wiard > >> >> >>> > >> >> >>> 2011/5/25 Christian Grün <christian.gruen at gmail.com> > >> >> >>>> > >> >> >>>> Hi Wiard, > >> >> >>>> > >> >> >>>> > I get the number of all documents as the number of hits. > >> >> >>>> > And what I want is the number of documents containing the term > >> >> >>>> > 'zonnebloemen'. > >> >> >>>> > Last time you had a solution for the number of hits in one > >> >> >>>> > specific > >> >> >>>> > document. > >> >> >>>> > I hope you have a solution for this problem. > >> >> >>>> > >> >> >>>> Could you provide us with a little document that allows us to > >> >> >>>> reproduce the problem? > >> >> >>>> > >> >> >>>> Thanks, > >> >> >>>> Christian > >> >> >>> > >> >> >> > >> >> >> > >> >> > > >> > > >> > > > > > >
WV
Wiard Vasen27 May 2011 08:52 #
Hi Christian,
With an earlier solution of yours I can also find combinations of words in the repository.
ft:count ( db:open('brievenvangogh')//*[text() contains text {'van','waarde','de','theo'}all ])
I am very happy with your help!
Regards,
Wiard
2011/5/27 Wiard Vasen <wiard.vasen at gmail.com>Quoted text · Wiard Vasen · 178 lines
> Wow, exactly what I was looking for! > > Thanks a lot Christian. > > > 2011/5/26 Christian Grün <christian.gruen at gmail.com> > >> Hi Wiard, >> >> the following query might give you the requested result: >> >> ft:count ( db:open('brievenvangogh')//*[text() contains text >> 'zonnebloemen'] ) >> >> Hope this helps, >> Christian >> ___________________________ >> >> On Thu, May 26, 2011 at 5:10 PM, Wiard Vasen <wiard.vasen at gmail.com> >> wrote: >> > Hi Christian, >> > The result should be: hits: 3. >> > In that case I can use the same query for all kind of terms. >> > Like; how many occurrences are there in the repository of the term " >> > gauguin", or "money". >> > That way I can both find the total number of occurrences as well as the >> > files containing the term. >> > I hope this answers your question. >> > Regards, >> > Wiard >> > >> > >> > >> > 2011/5/26 Christian Grün <christian.gruen at gmail.com> >> >> >> >> Hi Wiard, >> >> >> >> thanks for your answer. Just to get sure.. How should the result look >> >> like for the documents in question? ;) >> >> >> >> Christian >> >> >> >> On Thu, May 26, 2011 at 8:00 AM, Wiard Vasen <wiard.vasen at gmail.com> >> >> wrote: >> >> > Hi Christian, >> >> > Thank you for looking at the query. You are always a great help! >> >> > The result I am looking for is the total number of occurences. >> >> > Because there is such a large repository of letters. >> >> > With this number I am able to say that the word 'zonnebloemen' occurs >> 30 >> >> > times in all documents. For example. >> >> > I thought this could be accomplished with a small alteration of this >> >> > query. >> >> > If you see a solution that would be great, otherwise I just count >> them >> >> > by >> >> > hand. >> >> > Regards, >> >> > Wiard >> >> > >> >> > >> >> > 2011/5/26 Christian Grün <christian.gruen at gmail.com> >> >> >> >> >> >> Hi Wiard, >> >> >> >> >> >> finally a quick answer; the result seems correct to me, as the term >> >> >> "zonnebloemen" occurs in three of the documents that you sent to me. >> >> >> I've attached the result below; which result would you have >> expected? >> >> >> >> >> >> Christian >> >> >> >> >> >> >> >> >> <document uri="file:/G:/XML/brievenvangogh/let001.xml"/> >> >> >> <document uri="file:/G:/XML/brievenvangogh/let002.xml"/> >> >> >> <document uri="file:/G:/XML/brievenvangogh/let003.xml"/> >> >> >> <document uri="file:/G:/XML/brievenvangogh/let004.xml"/> >> >> >> <document uri="file:/G:/XML/brievenvangogh/let266.xml"> >> >> >> <hit score="0.2953945291203477" count="1"> >> >> >> <ab xmlns="http://www.tei-c.org/ns/1.0" rend="indent">Verder >> >> >> maakte ik nog een studie van een<lb n="28" xml:id="l-28"/>hofje met >> >> >> een bleek & zonnebloemen.<anchor n="4" xml:id="note-o-4"/> >> >> >> </ab> >> >> >> </hit> >> >> >> </document> >> >> >> <document uri="file:/G:/XML/brievenvangogh/let653.xml"> >> >> >> <hit score="0.2953945291203477" count="1"> >> >> >> <ab xmlns="http://www.tei-c.org/ns/1.0" rend="indent">Ik heb een >> >> >> studie van een tuin<c type="kk">/</c>haast een meter breed.<lb >> n="18" >> >> >> xml:id="l-18"/>op den voorgrond klaprozen & andere roode bloemen >> >> >> in groen.<lb n="19" xml:id="l-19"/>dan een vak<hi >> >> >> rend="ital">blaauwe</hi>klokken<c type="kp">_</c>Dan een vak<lb >> n="20" >> >> >> xml:id="l-20"/>oranje en geele afrikanen<c type="kk">/</c>dan witte >> en >> >> >> geele<lb n="21" xml:id="l-21"/>bloemen en eindelijk op den >> achtergrond >> >> >> rose en lilas<lb n="22" xml:id="l-22"/>en nog scabiosas<c >> >> >> type="kk">/</c>donkerviolet<c type="kk">/</c>en roode geraniums en >> >> >> zonnebloemen<lb n="23" xml:id="l-23"/>en een vijgeboom en laurier >> rose >> >> >> en een wingerd<c type="kp">_</c>Aan ’t eind zwarte<lb n="24" >> >> >> xml:id="l-24"/>cypressen tegen lage witte huisjes met oranje dak – >> en >> >> >> een fijn<lb n="25" xml:id="l-25"/>groenblaauwe strook lucht.<anchor >> >> >> n="1" xml:id="note-o-1"/> >> >> >> </ab> >> >> >> </hit> >> >> >> </document> >> >> >> <document uri="file:/G:/XML/brievenvangogh/let740.xml"> >> >> >> <hit score="1" count="1"> >> >> >> <hi xmlns="http://www.tei-c.org/ns/1.0" >> >> >> rend="ital">Zonnebloemen</hi> >> >> >> </hit> >> >> >> </document> >> >> >> >> >> >> >> >> >> >> >> >> On Wed, May 25, 2011 at 11:21 PM, Christian Grün >> >> >> <christian.gruen at gmail.com> wrote: >> >> >> > Hi Wiard, >> >> >> > >> >> >> > sorry for the delay; my todo list is long today, but I'll try to >> give >> >> >> > you some feedback soon (if not someone else is faster..). >> >> >> > >> >> >> > Christian >> >> >> > ___________________________ >> >> >> > >> >> >> > On Wed, May 25, 2011 at 8:56 PM, Wiard Vasen < >> wiard.vasen at gmail.com> >> >> >> > wrote: >> >> >> >> Hi Christian, >> >> >> >> Did I throw to much over the fence? >> >> >> >> Regards, >> >> >> >> Wiard >> >> >> >> >> >> >> >> 2011/5/25 Wiard Vasen <wiard.vasen at gmail.com> >> >> >> >>> >> >> >> >>> Hi Christian, >> >> >> >>> I hereby send you several xml-files containing the term >> >> >> >>> 'zonnebloemen'. >> >> >> >>> The first four documents(266,653,667,740) are with this term. >> >> >> >>> The last four(1,2,3,4) don't have the term. >> >> >> >>> Thanks for looking at my problem! >> >> >> >>> Regards, >> >> >> >>> Wiard >> >> >> >>> >> >> >> >>> 2011/5/25 Christian Grün <christian.gruen at gmail.com> >> >> >> >>>> >> >> >> >>>> Hi Wiard, >> >> >> >>>> >> >> >> >>>> > I get the number of all documents as the number of hits. >> >> >> >>>> > And what I want is the number of documents containing the >> term >> >> >> >>>> > 'zonnebloemen'. >> >> >> >>>> > Last time you had a solution for the number of hits in one >> >> >> >>>> > specific >> >> >> >>>> > document. >> >> >> >>>> > I hope you have a solution for this problem. >> >> >> >>>> >> >> >> >>>> Could you provide us with a little document that allows us to >> >> >> >>>> reproduce the problem? >> >> >> >>>> >> >> >> >>>> Thanks, >> >> >> >>>> Christian >> >> >> >>> >> >> >> >> >> >> >> >> >> >> >> > >> >> > >> >> > >> > >> > >> > >
Written for BaseX 6.6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery