RE: [MarkLogic Dev General] XML structure/schema design for MLS

2009-11-24 Thread Geert Josten
Hi Karl, > The normalization resulting from the use of the Actors > section makes it difficult to search. For example, to > perform a search against part of the body section that is > constrained to elements that are associated with a particular > actor, you cannot simply use the name of the acto

RE: [MarkLogic Dev General] RE: Prefix query

2009-11-24 Thread Lee, David
Thank you Exactly what I was looking for. I did try the wildcard search and it worked, but it was slow. I had all those extra index settings turned off. I'm re-indexing my DB right now. -Original Message- From: general-boun...@developer.marklogic.com [mailto:general-boun...@de

[MarkLogic Dev General] RE: Prefix query

2009-11-24 Thread Danny Sokolsky
That is a wildcard query. Something like: cts:word-query("Cod*", "wildcarded") You should have wildcard indexes enabled in your database for this. For most applications, an excellent set of wildcard indexes are (in addition to the default set of indexes): three character search word lexicon

[MarkLogic Dev General] Prefix query

2009-11-24 Thread Lee, David
Whats the right terminology or api for ML for a "prefix query" ? I want to search for "Cod" and have it match "Codeine" but NOT "nocode" I'm using cts:word-query() right now ... is that even the right one ? Is this a "Stemmed" or a "Wildcard" query ? Thanks for any suggestions

RE: [MarkLogic Dev General] RE: XML structure/schema design for MLS

2009-11-24 Thread Colleen Whitney
Hi Karl, The Search API is designed with some extensibility hooks in it that make it possible to wire in all sorts of queries that aren't supported out of the box yet. In this case, I think you could implement it using a custom constraint (see the Search Developer's Guide for some background r

[MarkLogic Dev General] RE: XML structure/schema design for MLS

2009-11-24 Thread Karl Erisman
Kelly, Your cts:element-query() example is exactly how I was planning on performing the search (I also mentioned something about post-processing with a FLOWR, but that would not be necessary). So, we've established that our goal is possible (clearly) in ML. Now, can the search be completed using

Re: [MarkLogic Dev General] RE: General Digest, Vol 65, Issue 65

2009-11-24 Thread Jason Hunter
> But that would requires putting knowledge of fragmentation into your code, > which won't make things more flexible.. Flexibility and maximum performance are often a tradeoff, in all pursuits. :) Think cars. Anyway, fragmentation policy is usually something that's decided early and doesn't

RE: [MarkLogic Dev General] RE: General Digest, Vol 65, Issue 65

2009-11-24 Thread Geert Josten
> The biggest win of using a full path instead of // in Mark > Logic is that once the fragment is fetched, it allows the > server to more quickly find the desired node within the > fragment. With // the server has to walk the whole fragment > tree while with a direct path it can go straight to the

Re: [MarkLogic Dev General] RE: General Digest, Vol 65, Issue 65

2009-11-24 Thread Jason Hunter
> However, in the case of ML, I would stick with your original advice: use full > paths to elements rather than //. In ML this allows the processor to use > several indexes to resolve the full path, rather than a single index. The biggest win of using a full path instead of // in Mark Logic is

[MarkLogic Dev General] RE: General Digest, Vol 65, Issue 65

2009-11-24 Thread Kelly Stirman
Hi Andrew, I agree, every processor has its own optimizations. :) However, in the case of ML, I would stick with your original advice: use full paths to elements rather than //. In ML this allows the processor to use several indexes to resolve the full path, rather than a single index. I woul

[MarkLogic Dev General] RE: XML structure/schema design for MLS

2009-11-24 Thread Kelly Stirman
Karl, Can you say how you would do this without using the SearchAPI? I would tend to use cts:element-query(): cts:search(doc(),cts:element-query(xs:QName("Actor"), cts:and-query(( cts:element-value-query(xs:QName("Text"),"Healthcare Provider"), cts:element-word-query(xs:QName("DisplayN

[MarkLogic Dev General] RE: Novice question: How to access named attributes of an element

2009-11-24 Thread Kelly Stirman
If you want the typed value of the attribute (e.g., date, integer, etc), you can use fn:data(): let $i := return fn:data($i/@name) --> name Another thing that might be useful is to know that the name and content attributes in your example are children of the meta element. If you navigate to

RE: [MarkLogic Dev General] Novice question: How to access namedattributes of an element

2009-11-24 Thread Lee, David
I'm not entirely clear on your question ... do you want to generate attributes or read them ? Presuming you mean read the attributes and print them, the trick is the "@" say for example Given Print out Meta name is name Meta content is value Use Meta name is {$article/bk:meta/@nam

Re: [MarkLogic Dev General] Novice question: How to access named attributes of an element

2009-11-24 Thread Andrew Welch
2009/11/24 Roland Butler : > I am able to use xquery to display the text associated with an element as > follows > > < > > title type="main">Document Title > > {($article/bk:head/bk:title/text())} > > > But how can I get to attribute of an element? > > < > > meta name="name" content="value"/> > I w

[MarkLogic Dev General] Novice question: How to access named attributes of an element

2009-11-24 Thread Roland Butler
I am able to use xquery to display the text associated with an element as follows Document Title {($article/bk:head/bk:title/text())} But how can I get to attribute of an element? I want to print out the value text but don't know how? Regards, Roland Butler ***CONFIDENTIALITY NOTICE &

Re: [MarkLogic Dev General] XML structure/schema design for MLS

2009-11-24 Thread Andrew Welch
2009/11/23 Lee, David : > I think what Karl is expressing is frustration that basic xpath > expressions appear not to use indexes. > I too am 'in the dark' about that ... and would love some advise. > Why, for example >        cts:search( doc("doc.xml")/FOO/BAR , "text") > > uses index ("instant re