[MarkLogic Dev General] General Digest, Vol 93, Issue 20

Vedavalli Radhika radhika.kv at gmail.com
Tue Mar 13 13:52:17 PDT 2012


Sure. But removing the and-query is not solving my problem. Are there
any suggestions to solve my issue?

On 3/13/12, general-request at developer.marklogic.com
<general-request at developer.marklogic.com> wrote:
> Send General mailing list submissions to
> 	general at developer.marklogic.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://developer.marklogic.com/mailman/listinfo/general
> or, via email, send a message with subject or body 'help' to
> 	general-request at developer.marklogic.com
>
> You can reach the person managing the list at
> 	general-owner at developer.marklogic.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of General digest..."
>
>
> Today's Topics:
>
>    1. Re: search:search() - show phrase results	first
>       (Stephane Toussaint)
>    2. Search - Additional Query (Vedavalli Radhika)
>    3. Re: Search - Additional Query (Vedavalli Radhika)
>    4. Re: Search - Additional Query (John Zhong)
>    5. Re: Time limit exceeded (Shah, Mehul (LNG-NPV))
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 12 Mar 2012 23:18:11 +0100
> From: Stephane Toussaint <stephane.toussaint at 4dconcept.fr>
> Subject: Re: [MarkLogic Dev General] search:search() - show phrase
> 	results	first
> To: MarkLogic Developer Discussion <general at developer.marklogic.com>
> Message-ID: <FBEC17D8-7DBE-44CC-AA21-0AC9FB0F9790 at 4dconcept.fr>
> Content-Type: text/plain; charset=iso-8859-1
>
> Hi,
>
> Have you let the "fast phrase searches" index setted ?
> Have you tried setting "the word positions" or "element word positions"
> index ?
>
> The more indexes you reached for matching a query, the best scoring you will
> have as a result.
>
> Regard,
> Stephane
>
> Le 12 mars 2012 ? 22:26, Danny Sinang a ?crit :
>
>> Hi,
>>
>> Am looking to implement a business rule that says "Phrase results must be
>> displayed before partials".
>>
>> So if, using search:search(), I looked for the phrase "medical research",
>> all results having that exact phrase should be shown first, followed by
>> results for "medical" and "research".
>>
>> A previous contractor managed to implement the generation of the phrase
>> results + partials.  But the problem is, some of the results for "medical"
>> and "research" are displayed first because of their higher scores.
>>
>> How do I tell MarkLogic to give phrase results a higher score instead ?
>>
>> Regards,
>> Danny
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> General mailing list
>> General at developer.marklogic.com
>> http://developer.marklogic.com/mailman/listinfo/general
>
>
>
> ------------------------------
>
> Message: 2
> Date: Tue, 13 Mar 2012 16:06:28 +0530
> From: Vedavalli Radhika <radhika.kv at gmail.com>
> Subject: [MarkLogic Dev General] Search - Additional Query
> To: General Mark Logic Developer Discussion
> 	<general at developer.marklogic.com>
> Message-ID:
> 	<CAJ0UdA14m1X9Vc4-m3=u1sCAx4v2Ah=cbf5Xs=YtULC+id6u1g at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> For the given format of xmls, I have to form facets of filtertype
> elements which has filtertype value as "source" alone.
>
> <ns8:activityitem>
> <ns5:filterlist>
> <ns2:filterlist><ns2:filter>
> <ns2:filtertype name="Source">source</ns2:filtertype>
> <ns2:filtervalue name="ABCD">ABCDE</ns2:filtervalue>
> <ns2:filtervalue name="1234">12345</ns2:filtervalue>
> </ns2:filter>
> </ns2:filterlist>
> <ns2:filterlist>
> <ns2:filter>
> <ns2:filtertype name="Source">domain</ns2:filtertype>
> <ns2:filtervalue name="FIVE">FIVES</ns2:filtervalue>
> </ns2:filter>
> </ns2:filterlist>
> </ns5:filterlist>
> </ns8:activityitem_marklogic>
>
> For the following code,
>
> let $options :=
> <options>
>
>     <additional-query>{cts:directory-query("/my-directory/",
> "infinity")}</additional-query>
> <additional-query>{for $x in cts:search(//cdi:filterlist,
> cts:directory-query("/my-directory/","infinity"))
> return $x/sc:filterlist/sc:filter[sc:filtertype eq
> "source"]/sc:filtervalue}</additional-query>
>
>     <constraint name="source">
>         <range type="xs:string" facet="true"
> collation="http://marklogic.com/collation/">
>                           <element ns="my-namespace" name="filtervalue" />
>  		   <attribute name="name" />
>                           <facet-option>frequency-order</facet-option>
>         </range>
>     </constraint>
> </options>
>
> let $result := mlsearch:search($queryString ,$options)
>
> return $result
>
> The facet results are as follows:
> <search:facet name="source">
> <search:facet-value name="ABCD" count="1">ABCD</search:facet-value>
> <search:facet-value name="1234" count="1">1234</search:facet-value>
> <search:facet-value name="FIVE" count="1">FIVE</search:facet-value>
> </search:facet>
>
> But whereas I expect only the first two entries.
> The query is returning all filtervalues in the given xml whenever it
> finds a filtertype element in it's xml with value as "source".
> But I am expecting only the filtervalues for which the sibling node
> filtertype has value as source.
>
> I tried to build a xquery using xpath. This is giving me expected
> results. But I am unable to fit this in the additional-query.
>
> for $x in cts:search(//ns5:filterlist,
> cts:directory-query("/my-directory/","infinity"))
> return $x/sc:filterlist/sc:filter[sc:filtertype eq "source"]/sc:filtervalue
>
> When I include the above inside additional-query, I am getting the
> following exception.
> "XDMP-QUERYELEM: cts:query(<cts:and-query
> xmlns:cts="http://marklogic.com/cts"><cts:and-query strength="20"
> qtextjoin=""><cts:and-query qtextco...</cts:and-query>) -- Query
> element contains unknown child: /cts:and-query"
>
> 1. Please help me resolve the issue.
> 2. I am also not sure if the above way is the best way to solve the
> problem. Give me your suggestions on how can I best(in terms of
> performance) solve the issue at hand.
>
> Thanks,
> Radhika.
>
>
> ------------------------------
>
> Message: 3
> Date: Tue, 13 Mar 2012 18:45:09 +0530
> From: Vedavalli Radhika <radhika.kv at gmail.com>
> Subject: Re: [MarkLogic Dev General] Search - Additional Query
> To: General Mark Logic Developer Discussion
> 	<general at developer.marklogic.com>
> Message-ID:
> 	<CAJ0UdA0g29SgZTt0Xh9M0ymC2-bT92+L5ALeO9CYHYpk49RbzQ at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> I wrongly typed the current query that I am using,
> It is the below:
> "let $options :=
> <options>
>
>     <additional-query>{cts:directory-query("/my-directory/",
> "infinity")}</additional-query>
>
> <additional-query>{cts:and-query(cts:element-value-query(xs:QName("sc:filtertype"),"source"))}</additional-query>
>
>     <constraint name="source">
>         <range type="xs:string" facet="true"
> collation="http://marklogic.com/collation/">
>                           <element ns="my-namespace" name="filtervalue" />
>  		   <attribute name="name" />
>                           <facet-option>frequency-order</facet-option>
>         </range>
>     </constraint>
> </options>
>
> let $result := mlsearch:search($queryString ,$options)
>
> return $result"
>
>
> On 3/13/12, Vedavalli Radhika <radhika.kv at gmail.com> wrote:
>> For the given format of xmls, I have to form facets of filtertype
>> elements which has filtertype value as "source" alone.
>>
>> <ns8:activityitem>
>> <ns5:filterlist>
>> <ns2:filterlist><ns2:filter>
>> <ns2:filtertype name="Source">source</ns2:filtertype>
>> <ns2:filtervalue name="ABCD">ABCDE</ns2:filtervalue>
>> <ns2:filtervalue name="1234">12345</ns2:filtervalue>
>> </ns2:filter>
>> </ns2:filterlist>
>> <ns2:filterlist>
>> <ns2:filter>
>> <ns2:filtertype name="Source">domain</ns2:filtertype>
>> <ns2:filtervalue name="FIVE">FIVES</ns2:filtervalue>
>> </ns2:filter>
>> </ns2:filterlist>
>> </ns5:filterlist>
>> </ns8:activityitem_marklogic>
>>
>> For the following code,
>>
>> let $options :=
>> <options>
>>
>>     <additional-query>{cts:directory-query("/my-directory/",
>> "infinity")}</additional-query>
>> <additional-query>{for $x in cts:search(//cdi:filterlist,
>> cts:directory-query("/my-directory/","infinity"))
>> return $x/sc:filterlist/sc:filter[sc:filtertype eq
>> "source"]/sc:filtervalue}</additional-query>
>>
>>     <constraint name="source">
>>         <range type="xs:string" facet="true"
>> collation="http://marklogic.com/collation/">
>>                           <element ns="my-namespace" name="filtervalue" />
>>  		   <attribute name="name" />
>>                           <facet-option>frequency-order</facet-option>
>>         </range>
>>     </constraint>
>> </options>
>>
>> let $result := mlsearch:search($queryString ,$options)
>>
>> return $result
>>
>> The facet results are as follows:
>> <search:facet name="source">
>> <search:facet-value name="ABCD" count="1">ABCD</search:facet-value>
>> <search:facet-value name="1234" count="1">1234</search:facet-value>
>> <search:facet-value name="FIVE" count="1">FIVE</search:facet-value>
>> </search:facet>
>>
>> But whereas I expect only the first two entries.
>> The query is returning all filtervalues in the given xml whenever it
>> finds a filtertype element in it's xml with value as "source".
>> But I am expecting only the filtervalues for which the sibling node
>> filtertype has value as source.
>>
>> I tried to build a xquery using xpath. This is giving me expected
>> results. But I am unable to fit this in the additional-query.
>>
>> for $x in cts:search(//ns5:filterlist,
>> cts:directory-query("/my-directory/","infinity"))
>> return $x/sc:filterlist/sc:filter[sc:filtertype eq
>> "source"]/sc:filtervalue
>>
>> When I include the above inside additional-query, I am getting the
>> following exception.
>> "XDMP-QUERYELEM: cts:query(<cts:and-query
>> xmlns:cts="http://marklogic.com/cts"><cts:and-query strength="20"
>> qtextjoin=""><cts:and-query qtextco...</cts:and-query>) -- Query
>> element contains unknown child: /cts:and-query"
>>
>> 1. Please help me resolve the issue.
>> 2. I am also not sure if the above way is the best way to solve the
>> problem. Give me your suggestions on how can I best(in terms of
>> performance) solve the issue at hand.
>>
>> Thanks,
>> Radhika.
>>
>
>
> ------------------------------
>
> Message: 4
> Date: Tue, 13 Mar 2012 21:26:45 +0800
> From: John Zhong <john at yuxipacific.com>
> Subject: Re: [MarkLogic Dev General] Search - Additional Query
> To: MarkLogic Developer Discussion <general at developer.marklogic.com>
> Message-ID:
> 	<CA+yakFn6N5zQKTPWXX0yZZCnE-gC1zGqfFa17OJY820VUaH32A at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> First comment is that you don't need the cts:and-query any more, it is said
> that all the additional-query will be combined using a cts:and-query...
>
> On Tue, Mar 13, 2012 at 9:15 PM, Vedavalli Radhika
> <radhika.kv at gmail.com>wrote:
>
>> I wrongly typed the current query that I am using,
>> It is the below:
>> "let $options :=
>> <options>
>>
>>    <additional-query>{cts:directory-query("/my-directory/",
>> "infinity")}</additional-query>
>>
>>
>> <additional-query>{cts:and-query(cts:element-value-query(xs:QName("sc:filtertype"),"source"))}</additional-query>
>>
>>    <constraint name="source">
>>        <range type="xs:string" facet="true"
>> collation="http://marklogic.com/collation/">
>>                          <element ns="my-namespace" name="filtervalue" />
>>                   <attribute name="name" />
>>                          <facet-option>frequency-order</facet-option>
>>        </range>
>>    </constraint>
>> </options>
>>
>> let $result := mlsearch:search($queryString ,$options)
>>
>> return $result"
>>
>>
>> On 3/13/12, Vedavalli Radhika <radhika.kv at gmail.com> wrote:
>> > For the given format of xmls, I have to form facets of filtertype
>> > elements which has filtertype value as "source" alone.
>> >
>> > <ns8:activityitem>
>> > <ns5:filterlist>
>> > <ns2:filterlist><ns2:filter>
>> > <ns2:filtertype name="Source">source</ns2:filtertype>
>> > <ns2:filtervalue name="ABCD">ABCDE</ns2:filtervalue>
>> > <ns2:filtervalue name="1234">12345</ns2:filtervalue>
>> > </ns2:filter>
>> > </ns2:filterlist>
>> > <ns2:filterlist>
>> > <ns2:filter>
>> > <ns2:filtertype name="Source">domain</ns2:filtertype>
>> > <ns2:filtervalue name="FIVE">FIVES</ns2:filtervalue>
>> > </ns2:filter>
>> > </ns2:filterlist>
>> > </ns5:filterlist>
>> > </ns8:activityitem_marklogic>
>> >
>> > For the following code,
>> >
>> > let $options :=
>> > <options>
>> >
>> >     <additional-query>{cts:directory-query("/my-directory/",
>> > "infinity")}</additional-query>
>> > <additional-query>{for $x in cts:search(//cdi:filterlist,
>> > cts:directory-query("/my-directory/","infinity"))
>> > return $x/sc:filterlist/sc:filter[sc:filtertype eq
>> > "source"]/sc:filtervalue}</additional-query>
>> >
>> >     <constraint name="source">
>> >         <range type="xs:string" facet="true"
>> > collation="http://marklogic.com/collation/">
>> >                           <element ns="my-namespace" name="filtervalue"
>> />
>> >                  <attribute name="name" />
>> >                           <facet-option>frequency-order</facet-option>
>> >         </range>
>> >     </constraint>
>> > </options>
>> >
>> > let $result := mlsearch:search($queryString ,$options)
>> >
>> > return $result
>> >
>> > The facet results are as follows:
>> > <search:facet name="source">
>> > <search:facet-value name="ABCD" count="1">ABCD</search:facet-value>
>> > <search:facet-value name="1234" count="1">1234</search:facet-value>
>> > <search:facet-value name="FIVE" count="1">FIVE</search:facet-value>
>> > </search:facet>
>> >
>> > But whereas I expect only the first two entries.
>> > The query is returning all filtervalues in the given xml whenever it
>> > finds a filtertype element in it's xml with value as "source".
>> > But I am expecting only the filtervalues for which the sibling node
>> > filtertype has value as source.
>> >
>> > I tried to build a xquery using xpath. This is giving me expected
>> > results. But I am unable to fit this in the additional-query.
>> >
>> > for $x in cts:search(//ns5:filterlist,
>> > cts:directory-query("/my-directory/","infinity"))
>> > return $x/sc:filterlist/sc:filter[sc:filtertype eq
>> "source"]/sc:filtervalue
>> >
>> > When I include the above inside additional-query, I am getting the
>> > following exception.
>> > "XDMP-QUERYELEM: cts:query(<cts:and-query
>> > xmlns:cts="http://marklogic.com/cts"><cts:and-query strength="20"
>> > qtextjoin=""><cts:and-query qtextco...</cts:and-query>) -- Query
>> > element contains unknown child: /cts:and-query"
>> >
>> > 1. Please help me resolve the issue.
>> > 2. I am also not sure if the above way is the best way to solve the
>> > problem. Give me your suggestions on how can I best(in terms of
>> > performance) solve the issue at hand.
>> >
>> > Thanks,
>> > Radhika.
>> >
>> _______________________________________________
>> General mailing list
>> General at developer.marklogic.com
>> http://developer.marklogic.com/mailman/listinfo/general
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://developer.marklogic.com/pipermail/general/attachments/20120313/5b94ecd2/attachment-0001.html
>
> ------------------------------
>
> Message: 5
> Date: Tue, 13 Mar 2012 13:38:01 +0000
> From: "Shah, Mehul (LNG-NPV)" <mehul.shah at lexisnexis.com>
> Subject: Re: [MarkLogic Dev General] Time limit exceeded
> To: MarkLogic Developer Discussion <general at developer.marklogic.com>
> Message-ID:
> 	<57DFA1552D6EF8419F80A8ADA10AF9F1017D91 at RETDAYMBXP007.legal.regn.net>
> Content-Type: text/plain; charset="us-ascii"
>
> Thanks Ron/Semerau.
> I am doing some repeated but temp work for pre-processing documents for
> which I found XQuery helpful.  Splitting/merging documents which needs to
> use xpath etc. to create proper documents;  in turn those are the documents
> that I will load using Information Studio.
> As this is something temporary for me, I am exploring to run this by
> changing timeout limits.
>
> Thanks,
> Mehul.
>
>
>
>
> From: general-bounces at developer.marklogic.com
> [mailto:general-bounces at developer.marklogic.com] On Behalf Of
> semerau at hotmail.com
> Sent: Monday, March 12, 2012 6:53 PM
> To: general at developer.marklogic.com
> Subject: Re: [MarkLogic Dev General] Time limit exceeded
>
> Came to say what Ron said. You don't want a single process running for 6
> hours. You'd have to have extremely long timeout settings (which is
> dangerous in case something else runs for too long and for locking
> resources), and if something errored at any time then the entire transaction
> would be rolled back. You are going to want to break the task into smaller
> jobs and put each job on the task server. This will also give you much
> better performance than a single process.
>
> If you are loading documents, you can use tools like Information Studio
> which comes with MarkLogic, or some of the other tools like what Ron
> mentioned. Using the task server isn't too hard so I'd suggest looking at
> that regardless and then picking what looks best for your situation/
>> From: ron at ronsoft.com
>> Date: Mon, 12 Mar 2012 22:39:26 +0000
>> To: general at developer.marklogic.com
>> Subject: Re: [MarkLogic Dev General] Time limit exceeded
>>
>>
>> You set the time limit on the appserver page in
>> the Admin UI: max time limit and default time limit.
>>
>> But if you're trying to do lots of updates, in the 100s
>> of thousands or millions, in a single transaction, it may
>> still blow up. Your code will need to acquire locks and
>> other resources as the transaction progresses.
>>
>> You're better off using a batch processing tool like
>> CORB that makes updates in reasonably sized chunks.
>>
>> On Mar 12, 2012, at 9:47 PM, Shah, Mehul (LNG-NPV) wrote:
>>
>> > I keep getting "Time limit exceeded" message for long running script.
>> >
>> > I have a Xquery script that processes documents, and I want to make sure
>> > it does not timeout for say 6 hours, is there a way to set it?
>> >
>> > Thanks.
>> >
>> > _______________________________________________
>> > General mailing list
>> > General at developer.marklogic.com<mailto:General at developer.marklogic.com>
>> > http://developer.marklogic.com/mailman/listinfo/general
>>
>> ---
>> Ron Hitchens {mailto:ron at ronsoft.com} Ronsoft Technologies
>> +44 7879 358 212 (voice) http://www.ronsoft.com
>> +1 707 924 3878 (fax) Bit Twiddling At Its Finest
>> "No amount of belief establishes any fact." -Unknown
>>
>>
>>
>>
>> _______________________________________________
>> General mailing list
>> General at developer.marklogic.com<mailto:General at developer.marklogic.com>
>> http://developer.marklogic.com/mailman/listinfo/general
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://developer.marklogic.com/pipermail/general/attachments/20120313/5b014424/attachment.html
>
> ------------------------------
>
> _______________________________________________
> General mailing list
> General at developer.marklogic.com
> http://developer.marklogic.com/mailman/listinfo/general
>
>
> End of General Digest, Vol 93, Issue 20
> ***************************************
>


More information about the General mailing list