XQuery - different results with text:match-any

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

XQuery - different results with text:match-any

Marcus-2
Hi,

i have some problems querying our database.
To keep my querys simple i tried to use the text-search function
"match-all" and "match-any"
but i'm getting wrong results with those functions :-(

My first statement was this one:
-------------------------------
for $doc in //text[@type='charter']
where ( .//supplier &= 'P*' )
and (.//idno != '')
order by xs:float($doc//idno)
return $doc
-------------------------------
Getting me a set of 80 results back - correct!

My second try was this one:
-------------------------------
xquery version "1.0";
import module namespace text="http://exist-db.org/xquery/text";
for $doc in //text[@type='charter'][.//idno != '']
[text:match-any((.//supplier) , ('P*'))]
order by xs:float($doc//idno)
return $doc
-------------------------------
I suppose that one should bring the same results, but i'm getting nearly
all data back all 1956 datasets as result :-(

Does this function only work with reg-expr???
... text:match-any((.//supplier) , ('^P[a-z]*')) ...
This one gives me back the same 80 results as the first one, but it
makes automatic querybuilding out of a form more difficult and tricky if
i can't use just the text-field input, but have to reform the input to a
reg-expr :-(


And of course, i wanted to use those functions, because i need a simple
way to query different paths for the same term at ones, i.e.
text:match-any( ((.//path1), (.//path2), (.//path3)) , ('searchterm'))
And i need the possibility to use "?" and "*" in my Searchterms to
substitute "1" or "0-n" letters.


Any advise or help is very appreciated.
Thanks a lot so far,
regards, Marcus



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: XQuery - different results with text:match-any

Erik Bruchez
Administrator
Did you try asking the eXist mailing-list?

-Erik

On Nov 27, 2008, at 12:06 PM, Marcus wrote:

> Hi,
>
> i have some problems querying our database.
> To keep my querys simple i tried to use the text-search function  
> "match-all" and "match-any"
> but i'm getting wrong results with those functions :-(
>
> My first statement was this one:
> -------------------------------
> for $doc in //text[@type='charter']
> where ( .//supplier &= 'P*' )
> and (.//idno != '')
> order by xs:float($doc//idno)
> return $doc
> -------------------------------
> Getting me a set of 80 results back - correct!
>
> My second try was this one:
> -------------------------------
> xquery version "1.0";
> import module namespace text="http://exist-db.org/xquery/text";
> for $doc in //text[@type='charter'][.//idno != '']
> [text:match-any((.//supplier) , ('P*'))]
> order by xs:float($doc//idno)
> return $doc
> -------------------------------
> I suppose that one should bring the same results, but i'm getting  
> nearly all data back all 1956 datasets as result :-(
>
> Does this function only work with reg-expr???
> ... text:match-any((.//supplier) , ('^P[a-z]*')) ...
> This one gives me back the same 80 results as the first one, but it  
> makes automatic querybuilding out of a form more difficult and  
> tricky if i can't use just the text-field input, but have to reform  
> the input to a reg-expr :-(
>
>
> And of course, i wanted to use those functions, because i need a  
> simple way to query different paths for the same term at ones, i.e.
> text:match-any( ((.//path1), (.//path2), (.//path3)) , ('searchterm'))
> And i need the possibility to use "?" and "*" in my Searchterms to  
> substitute "1" or "0-n" letters.
>
>
> Any advise or help is very appreciated.
> Thanks a lot so far,
> regards, Marcus
>
>
> --
> You receive this message as a subscriber of the [hidden email]  
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws