Re: [MarkLogic Dev General] Parallel Task Servers

2011-08-22 Thread Damon Feldman
Kashif,

Can you tell us more about the nature of the tasks, and how they are triggered? 
If the tasks themselves are slow it can back up the task server, or if a 
trigger fires more often than necessary and the task server needs to check for 
work that it then skips, that can also cause things to back up.

Damon

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Khan, Kashif
Sent: Monday, August 22, 2011 5:56 PM
To: General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Parallel Task Servers

Thanks for all the information. I really appreciate it.


Best Regards,
Kashif Khan
Sr. Solutions Architect
Houghton Mifflin Harcourt, Orlando, FL
Office: (407) 345-3420
Cell: (407) 949-4697

"The water you touch in the river is the last of that which has passed and the 
first of that which is coming" --Leonardo da Vinci

From: Wayne Feick mailto:wayne.fe...@marklogic.com>>
Reply-To: General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Date: Mon, 22 Aug 2011 17:52:53 -0400
To: "general@developer.marklogic.com" 
mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Parallel Task Servers

The limit is 256, but it has more to do with the number of CPU cores you have 
on the host balanced with how CPU intensive your application is (both tasks and 
application server activity).

For example, if you're doing lots of xdmp:http-get() operations from the task 
queue, a larger number of threads might be appropriate for parallelism. Tasks 
that tend to wait on disk I/O might also benefit from a larger number of 
threads.

On the other hand, if your tasks are CPU bound instead of I/O bound you won't 
want more than the number of cores on the host.

You should also keep in mind that a large number of task queue threads could 
negatively impact your application server performance since they'll be 
competing with each other for CPU and I/O resources.

Wayne.


On 08/22/2011 02:22 PM, Khan, Kashif wrote:
Is there a limit to the number of threads? I have set it to 10.

Best Regards,
Kashif Khan
Sr. Solutions Architect
Houghton Mifflin Harcourt, Orlando, FL
Office: (407) 345-3420
Cell: (407) 949-4697

"The water you touch in the river is the last of that which has passed and the 
first of that which is coming" --Leonardo da Vinci



From: Danny Sokolsky 
mailto:danny.sokol...@marklogic.com>>
Reply-To: General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Date: Mon, 22 Aug 2011 16:54:45 -0400
To: General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Parallel Task Servers

You would need to create a cluster.  Then direct your load at multiple hosts in 
that cluster.  This book:

http://docs.marklogic.com/4.2doc/docapp.xqy#display.xqy?fname=http://pubs/4.2doc/xml/cluster/title.xml

talks about some of that (as well as failover).

For example, if you had a cluster with host1, host2, and host3, then you can 
direct part of your load to host1, part to host2, and part to host3.

Now to step back a minute, why do you really need to do this?  The task server 
runs multi-threaded, so if you have extra horsepower on your host, you should 
be able to take advantage of that.

-Danny

From: 
general-boun...@developer.marklogic.com
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Khan, Kashif
Sent: Monday, August 22, 2011 1:26 PM
To: General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Parallel Task Servers

Is there somewhere I can read on creating parallel Hosts and dividing the load?

Best Regards,
Kashif Khan
Sr. Solutions Architect
Houghton Mifflin Harcourt, Orlando, FL
Office: (407) 345-3420
Cell: (407) 949-4697

"The water you touch in the river is the last of that which has passed and the 
first of that which is coming" --Leonardo da Vinci



From: Danny Sokolsky 
mailto:danny.sokol...@marklogic.com>>
Reply-To: General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Date: Mon, 22 Aug 2011 16:19:57 -0400
To: General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Parallel Task Servers

The way you do this is to parallelize the load across multiple hosts.  Each 
host has 1 task server.

-Danny

From: 
general-boun...@developer.marklogic.com
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Khan, Kashif
Sent: Monday, August 22, 2011 12:43 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Parallel Task Servers

Hello Everyone, I wanted to ask if it is possible to create multiple task 
servers to handle the load. So we can process the tasks on multiple task 
servers at a time.

Best Regards,
Kashif Khan




--

Wayne Feick

Principal Engin

Re: [MarkLogic Dev General] Parallel Task Servers

2011-08-22 Thread Khan, Kashif
Thanks for all the information. I really appreciate it.


Best Regards,
Kashif Khan
Sr. Solutions Architect
Houghton Mifflin Harcourt, Orlando, FL
Office: (407) 345-3420
Cell: (407) 949-4697

"The water you touch in the river is the last of that which has passed and the 
first of that which is coming" --Leonardo da Vinci

From: Wayne Feick mailto:wayne.fe...@marklogic.com>>
Reply-To: General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Date: Mon, 22 Aug 2011 17:52:53 -0400
To: "general@developer.marklogic.com" 
mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Parallel Task Servers

The limit is 256, but it has more to do with the number of CPU cores you have 
on the host balanced with how CPU intensive your application is (both tasks and 
application server activity).

For example, if you're doing lots of xdmp:http-get() operations from the task 
queue, a larger number of threads might be appropriate for parallelism. Tasks 
that tend to wait on disk I/O might also benefit from a larger number of 
threads.

On the other hand, if your tasks are CPU bound instead of I/O bound you won't 
want more than the number of cores on the host.

You should also keep in mind that a large number of task queue threads could 
negatively impact your application server performance since they'll be 
competing with each other for CPU and I/O resources.

Wayne.


On 08/22/2011 02:22 PM, Khan, Kashif wrote:
Is there a limit to the number of threads? I have set it to 10.

Best Regards,
Kashif Khan
Sr. Solutions Architect
Houghton Mifflin Harcourt, Orlando, FL
Office: (407) 345-3420
Cell: (407) 949-4697

"The water you touch in the river is the last of that which has passed and the 
first of that which is coming" --Leonardo da Vinci



From: Danny Sokolsky 
mailto:danny.sokol...@marklogic.com>>
Reply-To: General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Date: Mon, 22 Aug 2011 16:54:45 -0400
To: General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Parallel Task Servers

You would need to create a cluster.  Then direct your load at multiple hosts in 
that cluster.  This book:

http://docs.marklogic.com/4.2doc/docapp.xqy#display.xqy?fname=http://pubs/4.2doc/xml/cluster/title.xml

talks about some of that (as well as failover).

For example, if you had a cluster with host1, host2, and host3, then you can 
direct part of your load to host1, part to host2, and part to host3.

Now to step back a minute, why do you really need to do this?  The task server 
runs multi-threaded, so if you have extra horsepower on your host, you should 
be able to take advantage of that.

-Danny

From: 
general-boun...@developer.marklogic.com
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Khan, Kashif
Sent: Monday, August 22, 2011 1:26 PM
To: General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Parallel Task Servers

Is there somewhere I can read on creating parallel Hosts and dividing the load?

Best Regards,
Kashif Khan
Sr. Solutions Architect
Houghton Mifflin Harcourt, Orlando, FL
Office: (407) 345-3420
Cell: (407) 949-4697

"The water you touch in the river is the last of that which has passed and the 
first of that which is coming" --Leonardo da Vinci



From: Danny Sokolsky 
mailto:danny.sokol...@marklogic.com>>
Reply-To: General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Date: Mon, 22 Aug 2011 16:19:57 -0400
To: General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Parallel Task Servers

The way you do this is to parallelize the load across multiple hosts.  Each 
host has 1 task server.

-Danny

From: 
general-boun...@developer.marklogic.com
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Khan, Kashif
Sent: Monday, August 22, 2011 12:43 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Parallel Task Servers

Hello Everyone, I wanted to ask if it is possible to create multiple task 
servers to handle the load. So we can process the tasks on multiple task 
servers at a time.

Best Regards,
Kashif Khan



--
Wayne Feick
Principal Engineer
MarkLogic Corporation
wayne.fe...@marklogic.com
Phone: +1 650 655 2378
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 coo

Re: [MarkLogic Dev General] Parallel Task Servers

2011-08-22 Thread Wayne Feick
The limit is 256, but it has more to do with the number of CPU cores you 
have on the host balanced with how CPU intensive your application is 
(both tasks and application server activity).


For example, if you're doing lots of xdmp:http-get() operations from the 
task queue, a larger number of threads might be appropriate for 
parallelism. Tasks that tend to wait on disk I/O might also benefit from 
a larger number of threads.


On the other hand, if your tasks are CPU bound instead of I/O bound you 
won't want more than the number of cores on the host.


You should also keep in mind that a large number of task queue threads 
could negatively impact your application server performance since 
they'll be competing with each other for CPU and I/O resources.


Wayne.


On 08/22/2011 02:22 PM, Khan, Kashif wrote:

Is there a limit to the number of threads? I have set it to 10.

Best Regards,

Kashif Khan

Sr. Solutions Architect

Houghton Mifflin Harcourt, Orlando, FL

Office: (407) 345-3420

Cell: (407) 949-4697

"The water you touch in the river is the last of that which has passed 
and the first of that which is coming"*--Leonardo da Vinci*


*
*
*
*

From: Danny Sokolsky >
Reply-To: General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>

Date: Mon, 22 Aug 2011 16:54:45 -0400
To: General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>

Subject: Re: [MarkLogic Dev General] Parallel Task Servers

You would need to create a cluster.  Then direct your load at multiple 
hosts in that cluster.  This book:


http://docs.marklogic.com/4.2doc/docapp.xqy#display.xqy?fname=http://pubs/4.2doc/xml/cluster/title.xml

talks about some of that (as well as failover).

For example, if you had a cluster with host1, host2, and host3, then 
you can direct part of your load to host1, part to host2, and part to 
host3.


Now to step back a minute, why do you really need to do this?  The 
task server runs multi-threaded, so if you have extra horsepower on 
your host, you should be able to take advantage of that.


-Danny

*From:*general-boun...@developer.marklogic.com 
 
[mailto:general-boun...@developer.marklogic.com] *On Behalf Of *Khan, 
Kashif

*Sent:* Monday, August 22, 2011 1:26 PM
*To:* General MarkLogic Developer Discussion
*Subject:* Re: [MarkLogic Dev General] Parallel Task Servers

Is there somewhere I can read on creating parallel Hosts and dividing 
the load?


Best Regards,

Kashif Khan

Sr. Solutions Architect

Houghton Mifflin Harcourt, Orlando, FL

Office: (407) 345-3420

Cell: (407) 949-4697

"The water you touch in the river is the last of that which has passed 
and the first of that which is coming"*--Leonardo da Vinci*


*From: *Danny Sokolsky >
*Reply-To: *General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>

*Date: *Mon, 22 Aug 2011 16:19:57 -0400
*To: *General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>

*Subject: *Re: [MarkLogic Dev General] Parallel Task Servers

The way you do this is to parallelize the load across multiple hosts.  
Each host has 1 task server.


-Danny

*From:*general-boun...@developer.marklogic.com 
 
[mailto:general-boun...@developer.marklogic.com] *On Behalf Of *Khan, 
Kashif

*Sent:* Monday, August 22, 2011 12:43 PM
*To:* MarkLogic Developer Discussion
*Subject:* [MarkLogic Dev General] Parallel Task Servers

Hello Everyone, I wanted to ask if it is possible to create multiple 
task servers to handle the load. So we can process the tasks on 
multiple task servers at a time.


Best Regards,

Kashif Khan



--
Wayne Feick
Principal Engineer
MarkLogic Corporation
wayne.fe...@marklogic.com
Phone: +1 650 655 2378
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.

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Parallel Task Servers

2011-08-22 Thread Khan, Kashif
Is there a limit to the number of threads? I have set it to 10.

Best Regards,
Kashif Khan
Sr. Solutions Architect
Houghton Mifflin Harcourt, Orlando, FL
Office: (407) 345-3420
Cell: (407) 949-4697

"The water you touch in the river is the last of that which has passed and the 
first of that which is coming" --Leonardo da Vinci



From: Danny Sokolsky 
mailto:danny.sokol...@marklogic.com>>
Reply-To: General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Date: Mon, 22 Aug 2011 16:54:45 -0400
To: General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Parallel Task Servers

You would need to create a cluster.  Then direct your load at multiple hosts in 
that cluster.  This book:

http://docs.marklogic.com/4.2doc/docapp.xqy#display.xqy?fname=http://pubs/4.2doc/xml/cluster/title.xml

talks about some of that (as well as failover).

For example, if you had a cluster with host1, host2, and host3, then you can 
direct part of your load to host1, part to host2, and part to host3.

Now to step back a minute, why do you really need to do this?  The task server 
runs multi-threaded, so if you have extra horsepower on your host, you should 
be able to take advantage of that.

-Danny

From: 
general-boun...@developer.marklogic.com
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Khan, Kashif
Sent: Monday, August 22, 2011 1:26 PM
To: General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Parallel Task Servers

Is there somewhere I can read on creating parallel Hosts and dividing the load?

Best Regards,
Kashif Khan
Sr. Solutions Architect
Houghton Mifflin Harcourt, Orlando, FL
Office: (407) 345-3420
Cell: (407) 949-4697

"The water you touch in the river is the last of that which has passed and the 
first of that which is coming" --Leonardo da Vinci



From: Danny Sokolsky 
mailto:danny.sokol...@marklogic.com>>
Reply-To: General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Date: Mon, 22 Aug 2011 16:19:57 -0400
To: General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Parallel Task Servers

The way you do this is to parallelize the load across multiple hosts.  Each 
host has 1 task server.

-Danny

From: 
general-boun...@developer.marklogic.com
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Khan, Kashif
Sent: Monday, August 22, 2011 12:43 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Parallel Task Servers

Hello Everyone, I wanted to ask if it is possible to create multiple task 
servers to handle the load. So we can process the tasks on multiple task 
servers at a time.

Best Regards,
Kashif Khan

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Parallel Task Servers

2011-08-22 Thread Michael Blakeley
Assuming the host has idle resources, try increasing the task server thread 
limit. I believe the default is 4, which is a reasonable value for most 
applications. But if you have a lot of idle cores, you could increase it.

http://docs.marklogic.com/4.2doc/docapp.xqy#display.xqy?fname=http://pubs/4.2doc/adminhelp/task.xml

-- Mike

On 22 Aug 2011, at 14:03 , Khan, Kashif wrote:

> Thanks. I was looking into doing this as sometimes there are too many tasks 
> and the Taskserver is backed up with thousands of tasks. I am Just looking at 
> ways to load balance the tasks to make it go fast. 
> 
> Best Regards,
> Kashif Khan
> Sr. Solutions Architect
> Houghton Mifflin Harcourt, Orlando, FL
> Office: (407) 345-3420
> Cell: (407) 949-4697
>  
> "The water you touch in the river is the last of that which has passed and 
> the first of that which is coming" --Leonardo da Vinci
> 
> 
> 
> 
> 
> From: Danny Sokolsky 
> Reply-To: General MarkLogic Developer Discussion 
> 
> Date: Mon, 22 Aug 2011 16:54:45 -0400
> To: General MarkLogic Developer Discussion 
> Subject: Re: [MarkLogic Dev General] Parallel Task Servers
> 
> You would need to create a cluster.  Then direct your load at multiple hosts 
> in that cluster.  This book:
>  
> http://docs.marklogic.com/4.2doc/docapp.xqy#display.xqy?fname=http://pubs/4.2doc/xml/cluster/title.xml
>  
> talks about some of that (as well as failover).
>  
> For example, if you had a cluster with host1, host2, and host3, then you can 
> direct part of your load to host1, part to host2, and part to host3.
>  
> Now to step back a minute, why do you really need to do this?  The task 
> server runs multi-threaded, so if you have extra horsepower on your host, you 
> should be able to take advantage of that.
>  
> -Danny
>  
> From: general-boun...@developer.marklogic.com 
> [mailto:general-boun...@developer.marklogic.com] On Behalf Of Khan, Kashif
> Sent: Monday, August 22, 2011 1:26 PM
> To: General MarkLogic Developer Discussion
> Subject: Re: [MarkLogic Dev General] Parallel Task Servers
>  
> Is there somewhere I can read on creating parallel Hosts and dividing the 
> load?
>  
> Best Regards,
> Kashif Khan
> Sr. Solutions Architect
> Houghton Mifflin Harcourt, Orlando, FL
> Office: (407) 345-3420
> Cell: (407) 949-4697
>  
> "The water you touch in the river is the last of that which has passed and 
> the first of that which is coming" --Leonardo da Vinci
>  
>  
>  
> From: Danny Sokolsky 
> Reply-To: General MarkLogic Developer Discussion 
> 
> Date: Mon, 22 Aug 2011 16:19:57 -0400
> To: General MarkLogic Developer Discussion 
> Subject: Re: [MarkLogic Dev General] Parallel Task Servers
>  
> The way you do this is to parallelize the load across multiple hosts.  Each 
> host has 1 task server.
>  
> -Danny
>  
> From: general-boun...@developer.marklogic.com 
> [mailto:general-boun...@developer.marklogic.com] On Behalf Of Khan, Kashif
> Sent: Monday, August 22, 2011 12:43 PM
> To: MarkLogic Developer Discussion
> Subject: [MarkLogic Dev General] Parallel Task Servers
>  
> Hello Everyone, I wanted to ask if it is possible to create multiple task 
> servers to handle the load. So we can process the tasks on multiple task 
> servers at a time.
>  
> Best Regards,
> Kashif Khan
>  
> ___
> General mailing list
> General@developer.marklogic.com
> http://developer.marklogic.com/mailman/listinfo/general

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Parallel Task Servers

2011-08-22 Thread Khan, Kashif
Thanks. I was looking into doing this as sometimes there are too many tasks and 
the Taskserver is backed up with thousands of tasks. I am Just looking at ways 
to load balance the tasks to make it go fast.

Best Regards,
Kashif Khan
Sr. Solutions Architect
Houghton Mifflin Harcourt, Orlando, FL
Office: (407) 345-3420
Cell: (407) 949-4697

"The water you touch in the river is the last of that which has passed and the 
first of that which is coming" --Leonardo da Vinci



From: Danny Sokolsky 
mailto:danny.sokol...@marklogic.com>>
Reply-To: General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Date: Mon, 22 Aug 2011 16:54:45 -0400
To: General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Parallel Task Servers

You would need to create a cluster.  Then direct your load at multiple hosts in 
that cluster.  This book:

http://docs.marklogic.com/4.2doc/docapp.xqy#display.xqy?fname=http://pubs/4.2doc/xml/cluster/title.xml

talks about some of that (as well as failover).

For example, if you had a cluster with host1, host2, and host3, then you can 
direct part of your load to host1, part to host2, and part to host3.

Now to step back a minute, why do you really need to do this?  The task server 
runs multi-threaded, so if you have extra horsepower on your host, you should 
be able to take advantage of that.

-Danny

From: 
general-boun...@developer.marklogic.com
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Khan, Kashif
Sent: Monday, August 22, 2011 1:26 PM
To: General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Parallel Task Servers

Is there somewhere I can read on creating parallel Hosts and dividing the load?

Best Regards,
Kashif Khan
Sr. Solutions Architect
Houghton Mifflin Harcourt, Orlando, FL
Office: (407) 345-3420
Cell: (407) 949-4697

"The water you touch in the river is the last of that which has passed and the 
first of that which is coming" --Leonardo da Vinci



From: Danny Sokolsky 
mailto:danny.sokol...@marklogic.com>>
Reply-To: General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Date: Mon, 22 Aug 2011 16:19:57 -0400
To: General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Parallel Task Servers

The way you do this is to parallelize the load across multiple hosts.  Each 
host has 1 task server.

-Danny

From: 
general-boun...@developer.marklogic.com
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Khan, Kashif
Sent: Monday, August 22, 2011 12:43 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Parallel Task Servers

Hello Everyone, I wanted to ask if it is possible to create multiple task 
servers to handle the load. So we can process the tasks on multiple task 
servers at a time.

Best Regards,
Kashif Khan

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Parallel Task Servers

2011-08-22 Thread Danny Sokolsky
You would need to create a cluster.  Then direct your load at multiple hosts in 
that cluster.  This book:

http://docs.marklogic.com/4.2doc/docapp.xqy#display.xqy?fname=http://pubs/4.2doc/xml/cluster/title.xml

talks about some of that (as well as failover).

For example, if you had a cluster with host1, host2, and host3, then you can 
direct part of your load to host1, part to host2, and part to host3.

Now to step back a minute, why do you really need to do this?  The task server 
runs multi-threaded, so if you have extra horsepower on your host, you should 
be able to take advantage of that.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Khan, Kashif
Sent: Monday, August 22, 2011 1:26 PM
To: General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Parallel Task Servers

Is there somewhere I can read on creating parallel Hosts and dividing the load?

Best Regards,
Kashif Khan
Sr. Solutions Architect
Houghton Mifflin Harcourt, Orlando, FL
Office: (407) 345-3420
Cell: (407) 949-4697

"The water you touch in the river is the last of that which has passed and the 
first of that which is coming" --Leonardo da Vinci



From: Danny Sokolsky 
mailto:danny.sokol...@marklogic.com>>
Reply-To: General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Date: Mon, 22 Aug 2011 16:19:57 -0400
To: General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Parallel Task Servers

The way you do this is to parallelize the load across multiple hosts.  Each 
host has 1 task server.

-Danny

From: 
general-boun...@developer.marklogic.com
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Khan, Kashif
Sent: Monday, August 22, 2011 12:43 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Parallel Task Servers

Hello Everyone, I wanted to ask if it is possible to create multiple task 
servers to handle the load. So we can process the tasks on multiple task 
servers at a time.

Best Regards,
Kashif Khan

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Parallel Task Servers

2011-08-22 Thread Khan, Kashif
Is there somewhere I can read on creating parallel Hosts and dividing the load?

Best Regards,
Kashif Khan
Sr. Solutions Architect
Houghton Mifflin Harcourt, Orlando, FL
Office: (407) 345-3420
Cell: (407) 949-4697

"The water you touch in the river is the last of that which has passed and the 
first of that which is coming" --Leonardo da Vinci



From: Danny Sokolsky 
mailto:danny.sokol...@marklogic.com>>
Reply-To: General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Date: Mon, 22 Aug 2011 16:19:57 -0400
To: General MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Parallel Task Servers

The way you do this is to parallelize the load across multiple hosts.  Each 
host has 1 task server.

-Danny

From: 
general-boun...@developer.marklogic.com
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Khan, Kashif
Sent: Monday, August 22, 2011 12:43 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Parallel Task Servers

Hello Everyone, I wanted to ask if it is possible to create multiple task 
servers to handle the load. So we can process the tasks on multiple task 
servers at a time.

Best Regards,
Kashif Khan

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] count of an element in a document

2011-08-22 Thread Gary Larsen
No problem Ron. Haven't found a solution yet so it may require some data
modification.

gary


-Original Message-
From: general-boun...@developer.marklogic.com
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Ron Hitchens
Sent: Monday, August 22, 2011 9:26 AM
To: General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] count of an element in a document


   Sorry, I misread.  I thought you were looking
for elements that contained a value less than two.

On Aug 22, 2011, at 1:51 PM, Gary Larsen wrote:

> Hi Ron,
> 
> I don't think that cts:element-range-query() will get me the count of
nodes
> in each document.  What I think I'm looking for is something like
> cts:frequency() but I'm not sure how to include this as part of a
> constraining query. 
> 
> Thanks,
> gary
> 
> 
> -Original Message-
> From: general-boun...@developer.marklogic.com
> [mailto:general-boun...@developer.marklogic.com] On Behalf Of Ron Hitchens
> Sent: Monday, August 22, 2011 7:44 AM
> To: General MarkLogic Developer Discussion
> Subject: Re: [MarkLogic Dev General] count of an element in a document
> 
> 
>   If you can create a range index of the appropriate
> type on the element, you can use cts:element-range-query.
> 
>
http://developer.marklogic.com/pubs/4.2/apidocs/cts-query.html#cts:element-r
> ange-query
> 
> On Aug 22, 2011, at 11:33 AM, Gary Larsen wrote:
> 
>> Hi,
>> 
>> I would like to add a filter to a constraining query where the count of
an
> element in the document is less than two.  I should probably have that
> calculation in the document but hoping there is a cts query which can do
> that for me.
>> 
>> Thanks,
>> gary
>> 
>> ___
>> General mailing list
>> General@developer.marklogic.com
>> http://developer.marklogic.com/mailman/listinfo/general
> 
> ---
> Ron Hitchens {mailto:r...@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@developer.marklogic.com
> http://developer.marklogic.com/mailman/listinfo/general
> 
> ___
> General mailing list
> General@developer.marklogic.com
> http://developer.marklogic.com/mailman/listinfo/general

---
Ron Hitchens {mailto:r...@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@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Parallel Task Servers

2011-08-22 Thread Danny Sokolsky
The way you do this is to parallelize the load across multiple hosts.  Each 
host has 1 task server.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Khan, Kashif
Sent: Monday, August 22, 2011 12:43 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Parallel Task Servers

Hello Everyone, I wanted to ask if it is possible to create multiple task 
servers to handle the load. So we can process the tasks on multiple task 
servers at a time.

Best Regards,
Kashif Khan

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] searching document versions

2011-08-22 Thread Mike Sokolov
Thanks for the ideas, Danny.

I hear you about the pagination idea.  I think we will have to provide 
accurate counts for the entire result set anyway, which I don't think we 
could easily if we were playing client-side pagination tricks.

We are currently planning to insert is-latest data in each document.  
It's a little more complicated than simply tracking a single is-latest 
flag b/c of the requirement that different users get different slices of 
the data (so have different ideas about what's "latest"), but we do have 
a scheme for handling that in the data.

-Mike

On 08/22/2011 01:55 PM, Danny Sokolsky wrote:
> Hi Mike,
>
> Here are a few ideas.
>
> I'm wondering if a straight filtering approach might work fairly well here.  
> I think the answer depends on how frequent your updates are, and how likely 
> it is that an older version will have higher scores (ie, greater relevance) 
> than the latest version.  What I was thinking is that you can, instead of 
> getting the first 10 results, get the first 20 (or some such number) and then 
> filter them with the XPath you have.  This might be pretty inexpensive to do, 
> as you are only dealing with a small number of documents to filter.  The risk 
> of this approach is that there might be a newer version later down your 
> result sequence.  And it might be a bit trickier to paginate (but seems 
> possible to me).
>
> So I think it depends on what your nitty-gritty of your requirements are.
>
> Another thought is to put a range index on doc/@version and see if you can 
> construct a range query that can satisfy your constraint.  I can't off the 
> top of my head think of a way to do this, as you want to take the max, not 
> compare it to some value.  Maybe if you could identify some buckets of 
> versions (for example, if you knew that new versions were only added once a 
> week), then you can create a facet-like constraint, using 
> cts:element-attribute-value-ranges, for example.
>
> Of course, if you are putting a range index on version, then you can 
> relatively easily write a batch job to add a collection (as Ron mentioned) or 
> add another attribute called is-latest or something.  But it sounds like you 
> do not want to touch your documents (yet).
>
> -Danny
>
> -Original Message-
> From: general-boun...@developer.marklogic.com 
> [mailto:general-boun...@developer.marklogic.com] On Behalf Of Michael Sokolov
> Sent: Monday, August 22, 2011 4:47 AM
> To: General MarkLogic Developer Discussion
> Subject: Re: [MarkLogic Dev General] searching document versions
>
> On 8/22/2011 2:34 AM, Ron Hitchens wrote:
>
>>  Maybe collections could help here?  If the latest
>> version of each document is in the "LATEST" collection,
>> then it's simply:
>>
>>cts:search (doc(), cts:and-query (cts:collection-query ("LATEST"), 
>> $random-query))
>>
>>  You just need to make sure you manage collections
>> on ingest, so that when a new version of a document is
>> loaded, the previous latest version is removed from the
>> "LATEST" collection.
>>  
> Thanks Ron - yes, we could certainly do that, but the question was
> really about what the best you can do is if you don't allow any stored
> info.  For example, maybe some kind of grouping operation (group by
> document-id) followed by a selection (newest in the group) ... but I
> don't know how to do that in xquery, or whether that is possible.  Just
> wondering if there is some construct I'm unaware of that could help.
>
> -Mike
> ___
> General mailing list
> General@developer.marklogic.com
> http://developer.marklogic.com/mailman/listinfo/general
> ___
> General mailing list
> General@developer.marklogic.com
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


[MarkLogic Dev General] Parallel Task Servers

2011-08-22 Thread Khan, Kashif
Hello Everyone, I wanted to ask if it is possible to create multiple task 
servers to handle the load. So we can process the tasks on multiple task 
servers at a time.

Best Regards,
Kashif Khan

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] searching document versions

2011-08-22 Thread Danny Sokolsky
Hi Mike,

Here are a few ideas.

I'm wondering if a straight filtering approach might work fairly well here.  I 
think the answer depends on how frequent your updates are, and how likely it is 
that an older version will have higher scores (ie, greater relevance) than the 
latest version.  What I was thinking is that you can, instead of getting the 
first 10 results, get the first 20 (or some such number) and then filter them 
with the XPath you have.  This might be pretty inexpensive to do, as you are 
only dealing with a small number of documents to filter.  The risk of this 
approach is that there might be a newer version later down your result 
sequence.  And it might be a bit trickier to paginate (but seems possible to 
me).

So I think it depends on what your nitty-gritty of your requirements are.

Another thought is to put a range index on doc/@version and see if you can 
construct a range query that can satisfy your constraint.  I can't off the top 
of my head think of a way to do this, as you want to take the max, not compare 
it to some value.  Maybe if you could identify some buckets of versions (for 
example, if you knew that new versions were only added once a week), then you 
can create a facet-like constraint, using cts:element-attribute-value-ranges, 
for example.

Of course, if you are putting a range index on version, then you can relatively 
easily write a batch job to add a collection (as Ron mentioned) or add another 
attribute called is-latest or something.  But it sounds like you do not want to 
touch your documents (yet).

-Danny

-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Michael Sokolov
Sent: Monday, August 22, 2011 4:47 AM
To: General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] searching document versions

On 8/22/2011 2:34 AM, Ron Hitchens wrote:
> Maybe collections could help here?  If the latest
> version of each document is in the "LATEST" collection,
> then it's simply:
>
>   cts:search (doc(), cts:and-query (cts:collection-query ("LATEST"), 
> $random-query))
>
> You just need to make sure you manage collections
> on ingest, so that when a new version of a document is
> loaded, the previous latest version is removed from the
> "LATEST" collection.
Thanks Ron - yes, we could certainly do that, but the question was 
really about what the best you can do is if you don't allow any stored 
info.  For example, maybe some kind of grouping operation (group by 
document-id) followed by a selection (newest in the group) ... but I 
don't know how to do that in xquery, or whether that is possible.  Just 
wondering if there is some construct I'm unaware of that could help.

-Mike
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Triggers

2011-08-22 Thread Danny Sokolsky
In general, the "triggers" database is a logical concept, and you can use any 
DB for the triggers database (but you should not share triggers databases with 
other triggers databases, as you might write over other triggers).

That being said, there are some internal caches for the triggers database that 
MarkLogic maintains that might get invalidated more often if the triggers db is 
not its own database.  This might make some performance differences, as trigger 
modules might not be as heavily cached (I would guess these would tend to be 
minor, but in heavy update environments they might be more significant).  I 
would say that for most apps, having it as a separate db is the safest 
approach.   I sometimes use the content db as the triggers db, as it helps to 
simplify things (the application relies on fewer databases).   If the content 
does not change too often, then the simplification might justify any 
performance differences.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Ankur Acharya
Sent: Monday, August 22, 2011 8:14 AM
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] Triggers



Under what scenarios would the content database be used as the trigger 
database? There are examples that use two separate databases for storing 
content and triggers. And others that use the same database to store both.

Could someone point the advantages of choosing one over the other?
What is the recommended practice?

Much thanks,
Ankur

PS: "database coming online" is not a use case in the given setup of triggers
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


[MarkLogic Dev General] Sort by issue over element with same name

2011-08-22 Thread Abhishek53 S
Hi Folks

I am using search:search API to get the result from ML.I want to sort the 
result based on the "element title whose parent element does not have any 
index attribute" i.e. sorting over first title element in the sample xml. 
This seems to be impossible to me as the range indexing is created over 
the leaf element or element- attribute pair only..

I guess the only option is to restructure the content...Let me know if you 
have any other solution to over come the issue.



X


X


X


X



Thanks in advance
Abhishek Srivastav
Tata Consultancy Services
Cell:- +91-9883389968
Mailto: abhishek5...@tcs.com
Website: http://www.tcs.com

Experience certainty.   IT Services
Business Solutions
Outsourcing

=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


[MarkLogic Dev General] Triggers

2011-08-22 Thread Ankur Acharya
Under what scenarios would the content database be used as the trigger
database? There are examples that use two separate databases for storing
content and triggers. And others that use the same database to store both.

Could someone point the advantages of choosing one over the other?
What is the recommended practice?

Much thanks,
Ankur

PS: "database coming online" is not a use case in the given setup of
triggers
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Query on ML search

2011-08-22 Thread Abhishek53 S
Isha

I don't know If I property understood your question. If it is something 
like creating constraint with multiple attributes, then default constraint 
definition with more than one pair of element attribute is not possible. 
You need to create the custom constraint and the parse function of the 
custom query will be similar to

cts:element-attribute-range-query(
xs:QName("taxonomy-level") 
(xs:QName("id"),xs:QName("generation")  ),
"=",
$right-value
)

Hope this can serve your purpose a bit.

Thanks
Abhishek Srivastav
Tata Consultancy Services
Cell:- +91-9883389968
Mailto: abhishek5...@tcs.com
Website: http://www.tcs.com

Experience certainty.   IT Services
Business Solutions
Outsourcing




From:
isha chadha 
To:

Date:
08/22/2011 06:23 PM
Subject:
Re: [MarkLogic Dev General] Query on ML search
Sent by:
general-boun...@developer.marklogic.com



So basically, I am trying to figure out if there is a way to do something 
like:

Constraint added while performing a search


http://www.dods.co.uk/alfresco/content-meta/1.0"; name="taxonomy-level"/>
 
 



or 


 
http://www.dods.co.uk/alfresco/content-meta/1.0"; 
name="hierarchical-taxonomy"/>
 


From: ishacha...@hotmail.co.uk
To: general@developer.marklogic.com
Date: Mon, 22 Aug 2011 13:46:51 +0100
Subject: Re: [MarkLogic Dev General] Query on ML search

Thanks Abhishek.
This is what I am doing (Performing a reverse search)

ket  $search-options:= http://marklogic.com/appservices/search";>
true
true
true

http://marklogic.com/collation/";>
http://www.dods.co.uk/alfresco/content-properties/1.0"; name="type" />



http://marklogic.com/collation/";>
http://www.dods.co.uk/alfresco/content-meta/1.0"; name="source"/>



http://marklogic.com/collation/";>
http://dods.co.uk/ns/dod"; 
name="keyword"/>
{$facet-option-node} 




http://www.dods.co.uk/alfresco/content-meta/1.0"; name="taxonomy-level"/>
 



http://marklogic.com/collation/";>
http://www.dods.co.uk/alfresco/content-properties/1.0"; name="id"/>


http://dods.co.uk/modules/search/snippet-renderer";
at="/application/libraries/snippet-renderer.xqy"> 

http://docbook.org/ns/docbook"; 
name="title"/>

100
400

400
1

case-insensitive

fn:doc("C") 

;

let $reverse-search-options := http://marklogic.com/appservices/search";>
{$search-options/*}
fn:doc("C") 


(: get all search strings converted back from CTS :)
let $searchDocs := for $doc in A,B
(: either it matches or it does not :)
return if (search:search(
search:unparse($doc/child::node()),
 $reverse-search-options, 0, 1 )[@total gt 0]) then 
 (fn:doc(fn:base-uri($doc))) else ()
return FINAL RESULT

To: general@developer.marklogic.com
From: abhishek5...@tcs.com
Date: Mon, 22 Aug 2011 18:08:38 +0530
Subject: Re: [MarkLogic Dev General] Query on ML search


Isha 

Can you please put the options and query you are using for saerch? 

Thanks 
Abhishek Srivastav
Tata Consultancy Services
Cell:- +91-9883389968
Mailto: abhishek5...@tcs.com
Website: http://www.tcs.com

Experience certainty.IT Services
   Business Solutions
   Outsourcing
 


From: 
isha chadha  
To: 
 
Date: 
08/22/2011 06:01 PM 
Subject: 
[MarkLogic Dev General] Query on ML search 
Sent by: 
general-boun...@developer.marklogic.com




Hi All, 
  
I have a following use case: 
  
Two documents saved in ML against which to perform the search: 
  
A 
  
 
 
 
Climate 
change 
 
 
 
  
B 
 
 
 
Climate 
change 
Financing 
 
 
 
  
  
Newly inserted document to be searched 
  
C 
  
 
 
 
Climate 
change 
Financing 
 
 
 
  
  
Constraint I am using while performing a search 
 
 
http://www.dods.co.uk/alfresco/content-meta/1.0"; name="taxonomy-level"/> 
 
 
 
  
This results in both A and B getting selected. How can I make sure that 
only B gets selected as it is the exact match fo

Re: [MarkLogic Dev General] count of an element in a document

2011-08-22 Thread Ron Hitchens

   Sorry, I misread.  I thought you were looking
for elements that contained a value less than two.

On Aug 22, 2011, at 1:51 PM, Gary Larsen wrote:

> Hi Ron,
> 
> I don't think that cts:element-range-query() will get me the count of nodes
> in each document.  What I think I'm looking for is something like
> cts:frequency() but I'm not sure how to include this as part of a
> constraining query. 
> 
> Thanks,
> gary
> 
> 
> -Original Message-
> From: general-boun...@developer.marklogic.com
> [mailto:general-boun...@developer.marklogic.com] On Behalf Of Ron Hitchens
> Sent: Monday, August 22, 2011 7:44 AM
> To: General MarkLogic Developer Discussion
> Subject: Re: [MarkLogic Dev General] count of an element in a document
> 
> 
>   If you can create a range index of the appropriate
> type on the element, you can use cts:element-range-query.
> 
> http://developer.marklogic.com/pubs/4.2/apidocs/cts-query.html#cts:element-r
> ange-query
> 
> On Aug 22, 2011, at 11:33 AM, Gary Larsen wrote:
> 
>> Hi,
>> 
>> I would like to add a filter to a constraining query where the count of an
> element in the document is less than two.  I should probably have that
> calculation in the document but hoping there is a cts query which can do
> that for me.
>> 
>> Thanks,
>> gary
>> 
>> ___
>> General mailing list
>> General@developer.marklogic.com
>> http://developer.marklogic.com/mailman/listinfo/general
> 
> ---
> Ron Hitchens {mailto:r...@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@developer.marklogic.com
> http://developer.marklogic.com/mailman/listinfo/general
> 
> ___
> General mailing list
> General@developer.marklogic.com
> http://developer.marklogic.com/mailman/listinfo/general

---
Ron Hitchens {mailto:r...@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@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] count of an element in a document

2011-08-22 Thread Mike Sokolov
cts:frequency() will give you "item" occurrences if you pass that option 
to the element-range-query

-Mike


On 08/22/2011 08:51 AM, Gary Larsen wrote:
> Hi Ron,
>
> I don't think that cts:element-range-query() will get me the count of nodes
> in each document.  What I think I'm looking for is something like
> cts:frequency() but I'm not sure how to include this as part of a
> constraining query.
>
> Thanks,
> gary
>
>
> -Original Message-
> From: general-boun...@developer.marklogic.com
> [mailto:general-boun...@developer.marklogic.com] On Behalf Of Ron Hitchens
> Sent: Monday, August 22, 2011 7:44 AM
> To: General MarkLogic Developer Discussion
> Subject: Re: [MarkLogic Dev General] count of an element in a document
>
>
> If you can create a range index of the appropriate
> type on the element, you can use cts:element-range-query.
>
> http://developer.marklogic.com/pubs/4.2/apidocs/cts-query.html#cts:element-r
> ange-query
>
> On Aug 22, 2011, at 11:33 AM, Gary Larsen wrote:
>
>
>> Hi,
>>
>> I would like to add a filter to a constraining query where the count of an
>>  
> element in the document is less than two.  I should probably have that
> calculation in the document but hoping there is a cts query which can do
> that for me.
>
>>
>> Thanks,
>> gary
>>
>> ___
>> General mailing list
>> General@developer.marklogic.com
>> http://developer.marklogic.com/mailman/listinfo/general
>>  
> ---
> Ron Hitchens {mailto:r...@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@developer.marklogic.com
> http://developer.marklogic.com/mailman/listinfo/general
>
> ___
> General mailing list
> General@developer.marklogic.com
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Query on ML search

2011-08-22 Thread isha chadha

So basically, I am trying to figure out if there is a way to do something like:

Constraint 
added while performing a search



http://www.dods.co.uk/alfresco/content-meta/1.0"; 
name="taxonomy-level"/>

 
 




or 


 
http://www.dods.co.uk/alfresco/content-meta/1.0"; 
name="hierarchical-taxonomy"/>
 


From: ishacha...@hotmail.co.uk
To: general@developer.marklogic.com
Date: Mon, 22 Aug 2011 13:46:51 +0100
Subject: Re: [MarkLogic Dev General] Query on ML search








Thanks Abhishek.
This is what I am doing (Performing a reverse search)

ket  $search-options:= http://marklogic.com/appservices/search";>
true
true
true

http://marklogic.com/collation/";>
http://www.dods.co.uk/alfresco/content-properties/1.0"; name="type" />



http://marklogic.com/collation/";>
http://www.dods.co.uk/alfresco/content-meta/1.0"; name="source"/>



http://marklogic.com/collation/";>
http://dods.co.uk/ns/dod"; name="keyword"/>
{$facet-option-node}




http://www.dods.co.uk/alfresco/content-meta/1.0"; name="taxonomy-level"/>
 



http://marklogic.com/collation/";>
http://www.dods.co.uk/alfresco/content-properties/1.0"; name="id"/>


http://dods.co.uk/modules/search/snippet-renderer";
at="/application/libraries/snippet-renderer.xqy"> 

http://docbook.org/ns/docbook"; name="title"/>

100
400

400
1

case-insensitive

fn:doc("C") 

;

let $reverse-search-options := http://marklogic.com/appservices/search";>
{$search-options/*}
fn:doc("C") 


(: get all search strings converted back from CTS :)
let $searchDocs := for $doc in A,B
(: either it matches or it does not :)
return if (search:search(
search:unparse($doc/child::node()),
 $reverse-search-options, 0, 1 )[@total gt 0]) then 
 (fn:doc(fn:base-uri($doc))) else ()
return FINAL RESULT

To: general@developer.marklogic.com
From: abhishek5...@tcs.com
Date: Mon, 22 Aug 2011 18:08:38 +0530
Subject: Re: [MarkLogic Dev General] Query on ML search



Isha



Can you please put the options and query
you are using for saerch?



Thanks

Abhishek Srivastav

Tata Consultancy Services

Cell:- +91-9883389968

Mailto: abhishek5...@tcs.com

Website: http://www.tcs.com



Experience certainty.IT Services


   Business Solutions


   Outsourcing










From:
isha chadha 

To:


Date:
08/22/2011 06:01 PM

Subject:
[MarkLogic Dev General] Query on ML
search

Sent by:
general-boun...@developer.marklogic.com








Hi All, 

 

I have a following use case:

 

Two documents saved in ML against
which to perform the search:

 

A

 







Climate change







 

B







Climate change

Financing







 

 

Newly inserted document to
be searched 

 

C

 







Climate change

Financing







 

 

Constraint I am using while
performing a search



 
  

 
  http://www.dods.co.uk/alfresco/content-meta/1.0";
name="taxonomy-level"/>

 
   

 
  



 

This results in both A and
B getting selected. How can I make sure that only B gets selected as it
is the exact match for C?

 

Thanks,

Isha

 ___

General mailing list

General@developer.marklogic.com

http://developer.marklogic.com/mailman/listinfo/general





=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you



___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general 
  

___
General mailing list
General@develop

Re: [MarkLogic Dev General] Query on ML search

2011-08-22 Thread isha chadha

Thanks Abhishek.
This is what I am doing (Performing a reverse search)

ket  $search-options:= http://marklogic.com/appservices/search";>
true
true
true

http://marklogic.com/collation/";>
http://www.dods.co.uk/alfresco/content-properties/1.0"; name="type" />



http://marklogic.com/collation/";>
http://www.dods.co.uk/alfresco/content-meta/1.0"; name="source"/>



http://marklogic.com/collation/";>
http://dods.co.uk/ns/dod"; name="keyword"/>
{$facet-option-node}




http://www.dods.co.uk/alfresco/content-meta/1.0"; name="taxonomy-level"/>
 



http://marklogic.com/collation/";>
http://www.dods.co.uk/alfresco/content-properties/1.0"; name="id"/>


http://dods.co.uk/modules/search/snippet-renderer";
at="/application/libraries/snippet-renderer.xqy"> 

http://docbook.org/ns/docbook"; name="title"/>

100
400

400
1

case-insensitive

fn:doc("C") 

;

let $reverse-search-options := http://marklogic.com/appservices/search";>
{$search-options/*}
fn:doc("C") 


(: get all search strings converted back from CTS :)
let $searchDocs := for $doc in A,B
(: either it matches or it does not :)
return if (search:search(
search:unparse($doc/child::node()),
 $reverse-search-options, 0, 1 )[@total gt 0]) then 
 (fn:doc(fn:base-uri($doc))) else ()
return FINAL RESULT

To: general@developer.marklogic.com
From: abhishek5...@tcs.com
Date: Mon, 22 Aug 2011 18:08:38 +0530
Subject: Re: [MarkLogic Dev General] Query on ML search



Isha



Can you please put the options and query
you are using for saerch?



Thanks

Abhishek Srivastav

Tata Consultancy Services

Cell:- +91-9883389968

Mailto: abhishek5...@tcs.com

Website: http://www.tcs.com



Experience certainty.IT Services


   Business Solutions


   Outsourcing










From:
isha chadha 

To:


Date:
08/22/2011 06:01 PM

Subject:
[MarkLogic Dev General] Query on ML
search

Sent by:
general-boun...@developer.marklogic.com








Hi All, 

 

I have a following use case:

 

Two documents saved in ML against
which to perform the search:

 

A

 







Climate change







 

B







Climate change

Financing







 

 

Newly inserted document to
be searched 

 

C

 







Climate change

Financing







 

 

Constraint I am using while
performing a search



 
  

 
  http://www.dods.co.uk/alfresco/content-meta/1.0";
name="taxonomy-level"/>

 
   

 
  



 

This results in both A and
B getting selected. How can I make sure that only B gets selected as it
is the exact match for C?

 

Thanks,

Isha

 ___

General mailing list

General@developer.marklogic.com

http://developer.marklogic.com/mailman/listinfo/general





=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you



___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general 
  ___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] count of an element in a document

2011-08-22 Thread Gary Larsen
Hi Ron,

I don't think that cts:element-range-query() will get me the count of nodes
in each document.  What I think I'm looking for is something like
cts:frequency() but I'm not sure how to include this as part of a
constraining query. 

Thanks,
gary


-Original Message-
From: general-boun...@developer.marklogic.com
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Ron Hitchens
Sent: Monday, August 22, 2011 7:44 AM
To: General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] count of an element in a document


   If you can create a range index of the appropriate
type on the element, you can use cts:element-range-query.

http://developer.marklogic.com/pubs/4.2/apidocs/cts-query.html#cts:element-r
ange-query

On Aug 22, 2011, at 11:33 AM, Gary Larsen wrote:

> Hi,
>  
> I would like to add a filter to a constraining query where the count of an
element in the document is less than two.  I should probably have that
calculation in the document but hoping there is a cts query which can do
that for me.
>  
> Thanks,
> gary
>  
> ___
> General mailing list
> General@developer.marklogic.com
> http://developer.marklogic.com/mailman/listinfo/general

---
Ron Hitchens {mailto:r...@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@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Query on ML search

2011-08-22 Thread Abhishek53 S
Isha

Can you please put the options and query you are using for saerch?

Thanks
Abhishek Srivastav
Tata Consultancy Services
Cell:- +91-9883389968
Mailto: abhishek5...@tcs.com
Website: http://www.tcs.com

Experience certainty.   IT Services
Business Solutions
Outsourcing




From:
isha chadha 
To:

Date:
08/22/2011 06:01 PM
Subject:
[MarkLogic Dev General] Query on ML search
Sent by:
general-boun...@developer.marklogic.com



Hi All, 
 
I have a following use case:
 
Two documents saved in ML against which to perform the search:
 
A
 



Climate 
change



 
B



Climate 
change
Financing



 
 
Newly inserted document to be searched 
 
C
 



Climate 
change
Financing



 
 
Constraint I am using while performing a search


http://www.dods.co.uk/alfresco/content-meta/1.0"; name="taxonomy-level"/>
 


 
This results in both A and B getting selected. How can I make sure that 
only B gets selected as it is the exact match for C?
 
Thanks,
Isha
 ___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


[MarkLogic Dev General] Query on ML search

2011-08-22 Thread isha chadha



Hi All, 

 

I have a
following use case:

 

Two documents saved in ML against which to perform the search:

 

A

 







Climate
change







 

B







Climate
change

Financing







 

 

Newly inserted document to
be searched 

 

C

 







Climate
change

Financing







 

 

Constraint I am using while
performing a search



   


   
http://www.dods.co.uk/alfresco/content-meta/1.0";
name="taxonomy-level"/>

   
 

   




 

This results in both A and B
getting selected. How can I make sure that only B gets selected as it is the
exact match for C?

 

Thanks,

Isha

 

  ___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


[MarkLogic Dev General] FW: Query on ML search

2011-08-22 Thread isha chadha



From: ishacha...@hotmail.co.uk
To: general@developer.marklogic.com
Subject: Query on ML search
Date: Mon, 22 Aug 2011 13:27:50 +0100










Hi All, 

 

I have a
following use case:

 

Two documents saved in ML against which to perform the search:

 

A

 







Climate
change







 

B







Climate
change

Financing







 

 

Newly inserted document to
be searched 

 

C

 







Climate
change

Financing







 

 

Constraint I am using while
performing a search



   


   
http://www.dods.co.uk/alfresco/content-meta/1.0";
name="taxonomy-level"/>

   
 

   




 

This results in both A and B
getting selected. How can I make sure that only B gets selected as it is the
exact match for C?

 

Thanks,

Isha


  ___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] searching document versions

2011-08-22 Thread Michael Sokolov
On 8/22/2011 2:34 AM, Ron Hitchens wrote:
> Maybe collections could help here?  If the latest
> version of each document is in the "LATEST" collection,
> then it's simply:
>
>   cts:search (doc(), cts:and-query (cts:collection-query ("LATEST"), 
> $random-query))
>
> You just need to make sure you manage collections
> on ingest, so that when a new version of a document is
> loaded, the previous latest version is removed from the
> "LATEST" collection.
Thanks Ron - yes, we could certainly do that, but the question was 
really about what the best you can do is if you don't allow any stored 
info.  For example, maybe some kind of grouping operation (group by 
document-id) followed by a selection (newest in the group) ... but I 
don't know how to do that in xquery, or whether that is possible.  Just 
wondering if there is some construct I'm unaware of that could help.

-Mike
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] count of an element in a document

2011-08-22 Thread Ron Hitchens

   If you can create a range index of the appropriate
type on the element, you can use cts:element-range-query.

http://developer.marklogic.com/pubs/4.2/apidocs/cts-query.html#cts:element-range-query

On Aug 22, 2011, at 11:33 AM, Gary Larsen wrote:

> Hi,
>  
> I would like to add a filter to a constraining query where the count of an 
> element in the document is less than two.  I should probably have that 
> calculation in the document but hoping there is a cts query which can do that 
> for me.
>  
> Thanks,
> gary
>  
> ___
> General mailing list
> General@developer.marklogic.com
> http://developer.marklogic.com/mailman/listinfo/general

---
Ron Hitchens {mailto:r...@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@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


[MarkLogic Dev General] count of an element in a document

2011-08-22 Thread Gary Larsen
Hi,

 

I would like to add a filter to a constraining query where the count of an
element in the document is less than two.  I should probably have that
calculation in the document but hoping there is a cts query which can do
that for me.

 

Thanks,

gary

 

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] searching document versions

2011-08-22 Thread Ron Hitchens

   Maybe collections could help here?  If the latest
version of each document is in the "LATEST" collection,
then it's simply:

 cts:search (doc(), cts:and-query (cts:collection-query ("LATEST"), 
$random-query))

   You just need to make sure you manage collections
on ingest, so that when a new version of a document is
loaded, the previous latest version is removed from the
"LATEST" collection.

On Aug 22, 2011, at 2:08 AM, Michael Sokolov wrote:

> I'm looking for advice about how best to solve a querying problem for 
> one of our customers using MarkLogic.  We need to be able to search 
> documents that are stored in various versions, and we only want to 
> search the newest version. What I am interested in here is whether it is 
> possible to do this if the "newest version" property has to be computed, 
> not stored.  So something like:
> 
> for $doc in cts:search(doc(), $random-query)
> where $doc/@version = max(doc()/doc[@uri=$doc/@uri]/@version)
> return $doc
> 
> our documents store the document identifier that associates different 
> versions as /doc/@uri
> 
> Is that it? Maybe a range index on /doc/@uri would help there?
> 
> The real kicker is that we also need to be apply an additional 
> constraint in that some users may have access only to certain 
> document-versions, so in those cases we need to search only the newest 
> accessible version of each doc.
> 
> Of course there can be lots of docs matching the $random-query, we want 
> to be able to apply sorting criteria, and get the first page of results 
> efficiently.
> 
> Currently I am planning to generate tags at load-time that should make 
> the querying efficient (basically I will mark, for every possible 
> accessibility condition, the most current version - this is possible, if 
> irritating, due to the structure of the access control rules), but this 
> will introduce pain during document ingestion, and relies on 
> restrictions of the kind of access control rules we can have. So I'm 
> wondering if there is a passable query-time implementation I could use.
> 
> -Mike
> ___
> General mailing list
> General@developer.marklogic.com
> http://developer.marklogic.com/mailman/listinfo/general

---
Ron Hitchens {mailto:r...@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@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general