Mike,

On my 3.1-3.1 system, the exact same query comes back as expected:

cts:highlight(doc("/example.xml"),"martin luther
king",<hit>{$cts:text}</hit>)

=>
<name>
        <fname>
                <hit>Martin</hit>
        </fname>
        <fname>
                <hit>Luther</hit>
        </fname>
        <sname>
                <hit>King</hit>
        </sname>
</name>

I have set sname and fname as phrase-throughs. Can you please send me a
support-request output log? Let me know which database you are working
with.

Best,
Jose
 
Jose Espinoza
Support Engineer
Mark Logic Corporation 
2000 Alameda de las Pulgas 
Suite 100 
San Mateo, California 94403 
+1 650 655 2363 Phone 
+1 650 655 2310 Fax 
+1 650 255 9230 Mobile 
[EMAIL PROTECTED] 
www.marklogic.com 
 
This e-mail and any accompanying attachments are confidential. The
information is intended solely for the use of the individual to whom it
is addressed. Any review, disclosure, copying, distribution, or use of
this e-mail communication by others is strictly prohibited. If you are
not the intended recipient, please notify us immediately by returning
this message to the sender and delete all copies.  Thank you for your
cooperation.
 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mike
Sokolov
Sent: Thursday, November 02, 2006 1:55 PM
To: General Mark Logic Developer Discussion
Cc: support
Subject: Re: [MarkLogic Dev General] bug? cts:highlight and
phrase-through

Hi Jose - I am using 3.1-3.1; my case is a little different from yours 
in that the search I am doing is a phrase search:

cts:highlight(doc("/example.xml")/name,"martin luther
king",<hit>{$cts:text}</hit>


How does that work for you? I think you will need to add the elements to

your phrase-through list in order to get a match, right?

-Mike

Jose Espinoza wrote:
> Hi Mike,
>
> Which version of MarkLogic are you running this on? There was an issue
> with cts:highlight that was fixed in 3.1-3 which caused certain hits
to
> be missed. If you are on 3.1-3 or later, then please send me a sample
> search/highlight code that causes the problem.
>
> FYI - the following code works well for me in 3.1-3.1:
>
> let $node := <name>
>     <fname>Martin</fname>
>     <fname>Luther</fname>
>     <sname>King</sname>
> </name>
> return xdmp:document-insert(
>          "/example.xml", 
>        $node,
>          xdmp:default-permissions(), 
>          xdmp:default-collections())
>
> then, do the following:
>
> let $words :=("Martin", "Luther", "King")
>
> let $q1 := cts:or-query($words)
> let $q2 := cts:word-query($words)
>
> return 
> (cts:highlight(doc("/example.xml")/name,$q1,<hit>{$cts:text}</hit>),
>  cts:highlight(doc("/example.xml")/name,$q2,<hit>{$cts:text}</hit>))
>
> -----------------
>
> Best,
> Jose
>  
> Jose Espinoza
> Support Engineer
> Mark Logic Corporation 
> 2000 Alameda de las Pulgas 
> Suite 100 
> San Mateo, California 94403 
> +1 650 655 2363 Phone 
> +1 650 655 2310 Fax 
> +1 650 255 9230 Mobile 
> [EMAIL PROTECTED] 
> www.marklogic.com 
>  
> This e-mail and any accompanying attachments are confidential. The
> information is intended solely for the use of the individual to whom
it
> is addressed. Any review, disclosure, copying, distribution, or use of
> this e-mail communication by others is strictly prohibited. If you are
> not the intended recipient, please notify us immediately by returning
> this message to the sender and delete all copies.  Thank you for your
> cooperation.
>  
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Mike
> Sokolov
> Sent: Thursday, November 02, 2006 7:28 AM
> To: [email protected]
> Subject: [MarkLogic Dev General] bug? cts:highlight and phrase-through

>
> I have been observing some idiosyncratic behavior (ie bug) 
> w/cts:highlight.  I'd love it if someone could explain how it's not a 
> bug so I can fix my code, but I just don't see it.  Here's what I have

> in my document:
>
>
<name><fname>Martin</fname><fname>Luther</fname><sname>King</sname></nam
> e>
>
> All of the above tags ( are listed as phrase-throughs (and not 
> element-word-query-throughs - I have none of these).
>
> When I search for the phrase "martin luther king", the document 
> containing the above markup is found: good.  But when I highlight the 
> document (using <hit>{$cts:text}</hit> as the replacement), I get:
>
>
<name><fname><hit>Martin</hit></fname><fname>Luther</fname><sname><hit>K
> ing</hit></sname><ntitle>Jr.<ntitle><name>
>
> Look carefully - why wasn't Luther highlighted?
>
> This would be a minor cosmetic bug except that we are using the 
> cts:highlight to do tag text with cross-reference elements, so it ends

> up being pretty important for us, just FYI.
>
> -Mike Sokolov
>
>
>
> _______________________________________________
> General mailing list
> [email protected]
> http://xqzone.com/mailman/listinfo/general
> _______________________________________________
> General mailing list
> [email protected]
> http://xqzone.com/mailman/listinfo/general
>   
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to