Hi Danny,

This does not work, I had tried it when Colleen mentioned quoting the
string, although I wasn't totally sure that's what he meant. But, not,
doing '"Criminal B"' does not work, either using the original
default-suggestion-source I originally sent or the
constraint/suggestion-source of my later email. I still cannot get the
behavior I am seeking...completion on a string containing spaces. 

Nivaldo

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
[email protected]
Sent: Tuesday, July 27, 2010 6:11 PM
To: [email protected]
Subject: General Digest, Vol 73, Issue 63

Send General mailing list submissions to
        [email protected]

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
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of General digest..."


Today's Topics:

   1. search:suggest and apparent space problems (Fernandes, Nivaldo)
   2. Re: search:suggest and apparent space     problems (Danny
Sokolsky)
   3. Re: Prioritizing entries in the task      server  queue (Danny
Sokolsky)


----------------------------------------------------------------------

Message: 1
Date: Tue, 27 Jul 2010 15:01:32 -0400
From: "Fernandes, Nivaldo" <[email protected]>
Subject: [MarkLogic Dev General] search:suggest and apparent space
        problems
To: <[email protected]>
Message-ID:
        <[email protected]>
Content-Type: text/plain;       charset="us-ascii"

Thanks Coleen, it does explain the behavior...it completes on the second
term, B, and simply returns the first term, Criminal, as entered.
However, I thought this behavior would be the result of sending a
sequence of strings as the first parameter to search:suggest (the 2nd
and 3rd examples given under search:suggest) and not of sending a single
string with spaces in it.

Would you please consider replying with a bare-bones example on how to
quote the string to signal it as a single term to the parser, as you
explained?

[I attempted this with the use of a paired constraint and
suggestion-source, as in the last example under search:suggest), with
the addition of a term-option element under constraint (see the options
snippet I used immediately below), but that is not giving me the desired
behavior of getting completions for "Criminal B" (and not just for "B").
I must be approaching the concept of signalling the string as a single
term to the parser in the wrong way (search:parse perhaps?).
 
    <constraint name="tag">
        <range type="xs:string">
            <element ns="http://apa.org/pimain";
name="ClassificationDescription"/>
        </range>
        <term>
            <term-option>whitespace-insensitive</term-option>
        </term>
    </constraint>
    <suggestion-source name="tag">
        <range type="xs:string">
            <element ns="http://apa.org/pimain";
name="ClassificationDescription"/>
        </range>
    </suggestion-source>]

Thanks again!

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
[email protected]
Sent: Tuesday, July 27, 2010 3:00 PM
To: [email protected]
Subject: General Digest, Vol 73, Issue 62

Send General mailing list submissions to
        [email protected]

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
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of General digest..."


Today's Topics:

   1. search:suggest and apparent space problems (Fernandes, Nivaldo)
   2. Re: search:suggest and apparent space problems (Colleen Whitney)


----------------------------------------------------------------------

Message: 1
Date: Mon, 26 Jul 2010 21:52:28 -0400
From: "Fernandes, Nivaldo" <[email protected]>
Subject: [MarkLogic Dev General] search:suggest and apparent space
        problems
To: <[email protected]>
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset="us-ascii"

Hi,

 

I have been experiencing this problem reported here:

http://developer.marklogic.com/pipermail/general/2010-May/005436.html

I did not see any responses to this and perhaps the solution is obvious
but it has not occurred to me.

 

Here is my query:

>>> BEGIN QUERY
xquery version "1.0-ml";

import module namespace search =
"http://marklogic.com/appservices/search";

    at "/MarkLogic/appservices/search/search.xqy";

 

let $input :=  "Criminal"

 

let $options := 

<search:options xmlns="http://marklogic.com/appservices/search";>

 <default-suggestion-source>

  <range type="xs:string">

    <element ns="http://apa.org/pimain";
name="ClassificationDescription"/>

  </range>

</default-suggestion-source> 

</search:options>

 

let $results := search:suggest($input, $options)

    

return $results

>>> END QUERY

 

This returns:

"Criminal Behavior & Juvenile Delinquency"

"Criminal Law & Adjudication"

"Criminal Rehabilitation & Penology"

 

So, I go ahead and set my input as:

let $input := "Criminal B"

 

And here is what is returned:

Criminal "Behavior Disorders & Antisocial Behavior"

Criminal "Behavior Therapy & Behavior Modification"

Criminal "Behavioral & Psychological Treatment of Physical Illness"

 

Please note 2 things with the new results:

1) "Criminal Behavior $ Juvenile Delinquency" is no longer part of the
suggestions;

2) All suggestions returned seem to be a composite of "Criminal" and
"B..." (e.g. "Behavior Therapy & Behavior Modification" is actually a
separate entry in itself, that has nothing to do with the word
Criminal). It is as if the space between "Criminal" and "B" in the
$input are being taken as multiple search terms although I was under the
impression that this should be matching as a whole string against the
value lexicon in ClassificationDescription.

 

I am sure the solution is simple but I cannot see it at the moment. Help
is appreciated.

 

Thanks!

Nivaldo Fernandes 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://developer.marklogic.com/pipermail/general/attachments/20100726/a6
17f3f9/attachment-0001.html 

------------------------------

Message: 2
Date: Mon, 26 Jul 2010 19:51:40 -0700
From: Colleen Whitney <[email protected]>
Subject: Re: [MarkLogic Dev General] search:suggest and apparent space
        problems
To: General Mark Logic Developer Discussion
        <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

Nivaldo,

The search:suggest call uses the same parser as the rest of the API. To
the parser, your query is indeed treated as two separate terms unless
you quote it to signal that it should be treated as a single term.  The
completion is being done only on the second term.

Does this explain the behavior?

--Colleen

On Jul 26, 2010, at 6:52 PM, "Fernandes, Nivaldo"
<[email protected]<mailto:[email protected]>> wrote:

Hi,

I have been experiencing this problem reported here:
<http://developer.marklogic.com/pipermail/general/2010-May/005436.html>h
ttp://developer.marklogic.com/pipermail/general/2010-May/005436.html
I did not see any responses to this and perhaps the solution is obvious
but it has not occurred to me.

Here is my query:
>>> BEGIN QUERY
xquery version "1.0-ml";
import module namespace search =
"http://marklogic.com/appservices/search";
    at "/MarkLogic/appservices/search/search.xqy";

let $input :=  "Criminal"

let $options :=
<search:options xmlns="http://marklogic.com/appservices/search";>
 <default-suggestion-source>
  <range type="xs:string">
    <element ns="http://apa.org/pimain";
name="ClassificationDescription"/>
  </range>
</default-suggestion-source>
</search:options>

let $results := search:suggest($input, $options)

return $results
>>> END QUERY

This returns:
"Criminal Behavior & Juvenile Delinquency"
"Criminal Law & Adjudication"
"Criminal Rehabilitation & Penology"

So, I go ahead and set my input as:
let $input := ?Criminal B?

And here is what is returned:
Criminal "Behavior Disorders & Antisocial Behavior"
Criminal "Behavior Therapy & Behavior Modification"
Criminal "Behavioral & Psychological Treatment of Physical Illness"

Please note 2 things with the new results:
1) ?Criminal Behavior $ Juvenile Delinquency? is no longer part of the
suggestions;
2) All suggestions returned seem to be a composite of ?Criminal? and
?B?? (e.g. ?Behavior Therapy & Behavior Modification? is actually a
separate entry in itself, that has nothing to do with the word
Criminal). It is as if the space between ?Criminal? and ?B? in the
$input are being taken as multiple search terms although I was under the
impression that this should be matching as a whole string against the
value lexicon in ClassificationDescription.

I am sure the solution is simple but I cannot see it at the moment. Help
is appreciated.

Thanks!
Nivaldo Fernandes

_______________________________________________
General mailing list
[email protected]<mailto:[email protected]>
http://developer.marklogic.com/mailman/listinfo/general
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://developer.marklogic.com/pipermail/general/attachments/20100726/47
8f8a67/attachment-0001.html 

------------------------------

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general


End of General Digest, Vol 73, Issue 62
***************************************


------------------------------

Message: 2
Date: Tue, 27 Jul 2010 12:25:00 -0700
From: Danny Sokolsky <[email protected]>
Subject: Re: [MarkLogic Dev General] search:suggest and apparent space
        problems
To: General Mark Logic Developer Discussion
        <[email protected]>
Message-ID:
        
<[email protected]>
Content-Type: text/plain; charset="us-ascii"

Maybe:

search:suggest('"Criminal B"')

or if you have a constraint:

search:suggest('tag:"Criminal B"', $options)

-Danny

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Fernandes,
Nivaldo
Sent: Tuesday, July 27, 2010 12:02 PM
To: [email protected]
Subject: [MarkLogic Dev General] search:suggest and apparent space
problems

Thanks Coleen, it does explain the behavior...it completes on the second
term, B, and simply returns the first term, Criminal, as entered.
However, I thought this behavior would be the result of sending a
sequence of strings as the first parameter to search:suggest (the 2nd
and 3rd examples given under search:suggest) and not of sending a single
string with spaces in it.

Would you please consider replying with a bare-bones example on how to
quote the string to signal it as a single term to the parser, as you
explained?

[I attempted this with the use of a paired constraint and
suggestion-source, as in the last example under search:suggest), with
the addition of a term-option element under constraint (see the options
snippet I used immediately below), but that is not giving me the desired
behavior of getting completions for "Criminal B" (and not just for "B").
I must be approaching the concept of signalling the string as a single
term to the parser in the wrong way (search:parse perhaps?).
 
    <constraint name="tag">
        <range type="xs:string">
            <element ns="http://apa.org/pimain";
name="ClassificationDescription"/>
        </range>
        <term>
            <term-option>whitespace-insensitive</term-option>
        </term>
    </constraint>
    <suggestion-source name="tag">
        <range type="xs:string">
            <element ns="http://apa.org/pimain";
name="ClassificationDescription"/>
        </range>
    </suggestion-source>]

Thanks again!

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
[email protected]
Sent: Tuesday, July 27, 2010 3:00 PM
To: [email protected]
Subject: General Digest, Vol 73, Issue 62

Send General mailing list submissions to
        [email protected]

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
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of General digest..."


Today's Topics:

   1. search:suggest and apparent space problems (Fernandes, Nivaldo)
   2. Re: search:suggest and apparent space problems (Colleen Whitney)


----------------------------------------------------------------------

Message: 1
Date: Mon, 26 Jul 2010 21:52:28 -0400
From: "Fernandes, Nivaldo" <[email protected]>
Subject: [MarkLogic Dev General] search:suggest and apparent space
        problems
To: <[email protected]>
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset="us-ascii"

Hi,

 

I have been experiencing this problem reported here:

http://developer.marklogic.com/pipermail/general/2010-May/005436.html

I did not see any responses to this and perhaps the solution is obvious
but it has not occurred to me.

 

Here is my query:

>>> BEGIN QUERY
xquery version "1.0-ml";

import module namespace search =
"http://marklogic.com/appservices/search";

    at "/MarkLogic/appservices/search/search.xqy";

 

let $input :=  "Criminal"

 

let $options := 

<search:options xmlns="http://marklogic.com/appservices/search";>

 <default-suggestion-source>

  <range type="xs:string">

    <element ns="http://apa.org/pimain";
name="ClassificationDescription"/>

  </range>

</default-suggestion-source> 

</search:options>

 

let $results := search:suggest($input, $options)

    

return $results

>>> END QUERY

 

This returns:

"Criminal Behavior & Juvenile Delinquency"

"Criminal Law & Adjudication"

"Criminal Rehabilitation & Penology"

 

So, I go ahead and set my input as:

let $input := "Criminal B"

 

And here is what is returned:

Criminal "Behavior Disorders & Antisocial Behavior"

Criminal "Behavior Therapy & Behavior Modification"

Criminal "Behavioral & Psychological Treatment of Physical Illness"

 

Please note 2 things with the new results:

1) "Criminal Behavior $ Juvenile Delinquency" is no longer part of the
suggestions;

2) All suggestions returned seem to be a composite of "Criminal" and
"B..." (e.g. "Behavior Therapy & Behavior Modification" is actually a
separate entry in itself, that has nothing to do with the word
Criminal). It is as if the space between "Criminal" and "B" in the
$input are being taken as multiple search terms although I was under the
impression that this should be matching as a whole string against the
value lexicon in ClassificationDescription.

 

I am sure the solution is simple but I cannot see it at the moment. Help
is appreciated.

 

Thanks!

Nivaldo Fernandes 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://developer.marklogic.com/pipermail/general/attachments/20100726/a6
17f3f9/attachment-0001.html 

------------------------------

Message: 2
Date: Mon, 26 Jul 2010 19:51:40 -0700
From: Colleen Whitney <[email protected]>
Subject: Re: [MarkLogic Dev General] search:suggest and apparent space
        problems
To: General Mark Logic Developer Discussion
        <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

Nivaldo,

The search:suggest call uses the same parser as the rest of the API. To
the parser, your query is indeed treated as two separate terms unless
you quote it to signal that it should be treated as a single term.  The
completion is being done only on the second term.

Does this explain the behavior?

--Colleen

On Jul 26, 2010, at 6:52 PM, "Fernandes, Nivaldo"
<[email protected]<mailto:[email protected]>> wrote:

Hi,

I have been experiencing this problem reported here:
<http://developer.marklogic.com/pipermail/general/2010-May/005436.html>h
ttp://developer.marklogic.com/pipermail/general/2010-May/005436.html
I did not see any responses to this and perhaps the solution is obvious
but it has not occurred to me.

Here is my query:
>>> BEGIN QUERY
xquery version "1.0-ml";
import module namespace search =
"http://marklogic.com/appservices/search";
    at "/MarkLogic/appservices/search/search.xqy";

let $input :=  "Criminal"

let $options :=
<search:options xmlns="http://marklogic.com/appservices/search";>
 <default-suggestion-source>
  <range type="xs:string">
    <element ns="http://apa.org/pimain";
name="ClassificationDescription"/>
  </range>
</default-suggestion-source>
</search:options>

let $results := search:suggest($input, $options)

return $results
>>> END QUERY

This returns:
"Criminal Behavior & Juvenile Delinquency"
"Criminal Law & Adjudication"
"Criminal Rehabilitation & Penology"

So, I go ahead and set my input as:
let $input := ?Criminal B?

And here is what is returned:
Criminal "Behavior Disorders & Antisocial Behavior"
Criminal "Behavior Therapy & Behavior Modification"
Criminal "Behavioral & Psychological Treatment of Physical Illness"

Please note 2 things with the new results:
1) ?Criminal Behavior $ Juvenile Delinquency? is no longer part of the
suggestions;
2) All suggestions returned seem to be a composite of ?Criminal? and
?B?? (e.g. ?Behavior Therapy & Behavior Modification? is actually a
separate entry in itself, that has nothing to do with the word
Criminal). It is as if the space between ?Criminal? and ?B? in the
$input are being taken as multiple search terms although I was under the
impression that this should be matching as a whole string against the
value lexicon in ClassificationDescription.

I am sure the solution is simple but I cannot see it at the moment. Help
is appreciated.

Thanks!
Nivaldo Fernandes

_______________________________________________
General mailing list
[email protected]<mailto:[email protected]>
http://developer.marklogic.com/mailman/listinfo/general
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://developer.marklogic.com/pipermail/general/attachments/20100726/47
8f8a67/attachment-0001.html 

------------------------------

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general


End of General Digest, Vol 73, Issue 62
***************************************
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general


------------------------------

Message: 3
Date: Tue, 27 Jul 2010 15:10:52 -0700
From: Danny Sokolsky <[email protected]>
Subject: Re: [MarkLogic Dev General] Prioritizing entries in the task
        server  queue
To: General Mark Logic Developer Discussion
        <[email protected]>
Message-ID:
        
<[email protected]>
Content-Type: text/plain; charset="us-ascii"

Hi Tim,

I don't think there is any way to de-prioritize the order of something
on the task server queue once it is already spawned.  If you wanted to
do that, it would have to be before it is spawned.

What you might be able to do (and I think you hinted at this in your
question) is to use a different host to spawn the tasks to.  The host
that a task is spawned to is the same host in which the query is
evaluated (the e-node), so you can try to send higher priority tasks to
a different (and less used) e-node.  I am not sure what the best way to
do this is, and I would guess that would depend on your application.  It
could be as simple as having some dispatcher code somewhere that looks
at the priority (your application would have to supply this) and then
redirects the query to another server.  Or you could do it in a load
balancer or proxy forwarder.  By the time it gets to CPF, however, it is
probably too late, so this would have to come before the CPF event is
triggered.

I don't know of another way to do this, as there is no API do remove or
reorder items in the task server queue.

-Danny

From: [email protected]
[mailto:[email protected]] On Behalf Of Tim
Meagher
Sent: Monday, July 26, 2010 4:13 AM
To: 'General Mark Logic Developer Discussion'
Subject: [MarkLogic Dev General] Prioritizing entries in the task server
queue

Hi Folks,

I have a workflow for processing documents of various priorities using
the Content Processing Framework.  The problem I'm running into is that
I might get 10,000 documents that need to be processed at a low priority
which get submitted to the task server queue, but then maybe 10
documents come in that are of a higher priority (I'm using these counts
for purposes of discussion).  What I would like to be able to do is to
insert the 10 high priority items in the queue so that they are
processed before any outstanding low priority items in the task server
queue, in other words I want to interrupt FIFO processing.  I'm not
concerned about the high priority processing starving low priority
processing as the volume of the high priority items is relatively low,
but nonetheless an elegant solution would allow me to fine-tune the
process so that low priority starvation does not occur.

There was some previous discussion about using tail-recursion with
xdmp:spawn.  That way I would hopefully be able to select the next
document to process based on its relative priority.  In that case I
would probably want to revise the CPF process to merely fill customized
priority queues, e.g. high, mid, and low priority queues and to use tail
recursion to examine the queues and decide which document to process
next.

I get the impression that clustering could be a useful way to create
task servers that are dedicated to higher and lower priority processing
for the needs of an entire organization, but it seems to me that
allowing for pre-emption in a given task server could be a really useful
feature.

Perhaps there are some existing features that are provided to deal with
just this problem.  There are times when I've submitted more docs to be
processed by the task server and would like to be able to dequeue them -
I suppose that a prioritization solution would also allow for dequeuing
tasks.

Thanks ahead of time for any help!

Tim Meagher

-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://developer.marklogic.com/pipermail/general/attachments/20100727/fe
26bc03/attachment.html 

------------------------------

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general


End of General Digest, Vol 73, Issue 63
***************************************
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to