From: Rob v. S. <va...@nl...> - 2007-11-26 13:10:35
|
Kevin, Thanks for your answer. I'm familiar with the use of |= and &=. The point is that I try to find records where I have an exact (case insensitive) match of a text node with the word I'm looking for (like <keyword>radar</keyword>). The strange thing is that I my query (using $record/* = "radar") does not return anything but when I use $record/* |= "radar" it does. But then I also find the records with text nodes containing other text (like <keyword> radar optical</keyword>). Regards, Rob Kevin Benson wrote: > Hi Rob you might have to confirm this is what your seeing. > > But if I recall text in eXist is tokenized. So ' |= some_word ' is > like doing a or with ('some' or 'word') and use '&=' will be like > ('some' and 'word') the words need to be in the same text node but > can be anywhere in that text node. > > Finally there is also near() function you might want to try simliar to > &= but the words need to be next to one another unless you use the 3rd > parameter to allow them to be a number of words apart. > > cheers, > Kevin > > On Mon, 26 Nov 2007, Rob van Swol wrote: > >> Hi, >> >> I try to formulate my previous question again. >> I use (with exist-1.1.2dev) the forllowing query >> >> for $record in collection($c)//Dataset >> where (fn:matches($record/*, "^some_word$", "i")) >> return $record >> >> to get all records with text nodes=some_word (wherever in the xml). >> Nothing is returned. >> However the regular expressions with "^some_word" or "some_word$" give >> indeed text nodes starting with or ending on some_word. >> >> Secondly: >> for $record in collection($c)//Dataset >> where $record/* |= some_word >> return $record >> >> returns all records some text node contains "some_word'. However, using >> '$record/* = some_word' returns nothing. >> >> Any suggestions? >> Regards, >> Rob >> >> -- >> Rob W. van Swol >> National Aerospace Laboratory NLR >> P.O. Box 153 >> 8300 AD Emmeloord >> The Netherlands >> Tel. +31 527 248252 >> Fax +31 527 248210 >> E-mail va...@nl... >> http://www.nlr.nl/ >> >> >> ------------------------------------------------------------------------- >> >> This SF.net email is sponsored by: Microsoft >> Defy all challenges. Microsoft(R) Visual Studio 2005. >> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >> _______________________________________________ >> Exist-open mailing list >> Exi...@li... >> https://lists.sourceforge.net/lists/listinfo/exist-open >> > -- Rob W. van Swol National Aerospace Laboratory NLR P.O. Box 153 8300 AD Emmeloord The Netherlands Tel. +31 527 248252 Fax +31 527 248210 E-mail va...@nl... http://www.nlr.nl/ |