Thanks Mike.
We planned to go for HTTP Client over XDBC Connection.
I noticed better performance in running the query using Http Client
Connection.

I am facing few other issues.
I am trying to pass the dynamic values in the xquery(inside a xqy file -
search.xqy) as query parameters and as request body from the client.

Original XQuery:
for $a in cts:search(collection("collection_name"),
cts:and-query((cts:element-attribute-range-query(xs:QName("book"),
xs:QName("length"), ">=", 26),
cts:element-attribute-range-query(xs:QName("book"), xs:QName("length"),
"<=", 2620), cts:element-attribute-value-query(xs:QName("chapter"),
xs:QName("name"), ('chap1','chap2','chap3','chap4')))), ("score-simple"))

With dynamic inputs:
let $docMin := xs:integer(xdmp:get-request-field("docMin"))
let $docMax := xs:integer(xdmp:get-request-field("docMax"))
let $chapNames := xdmp:get-request-body()
for $a in cts:search(collection("collection_name"),
cts:and-query((cts:element-attribute-range-query(xs:QName("book"),
xs:QName("length"), ">=", $docMin),
cts:element-attribute-range-query(xs:QName("book"), xs:QName("length"),
"<=", $docMax), cts:element-attribute-value-query(xs:QName("chapter"),
xs:QName("name"), $chapNames))), ("score-simple"))

Client method in java:

 public static void searchContent(String queryParamString, String
chapterNames)
   throws ClientProtocolException, IOException, SysmanConfigException {
  DefaultHttpClient httpclient = constructHttpClient();
  HttpPost httpPost = new HttpPost(constructMarkLogicUri("/search.xqy"
    + "?docMin=1&docMax=15600"));// queryParamString
  HttpEntity entity = new StringEntity(
    "('chap1','chap2','chap3','chap4')");// chapterNames
  httpPost.setEntity(entity);
  // httpPost.setHeader("Content-Type", "text/plain; charset=UTF-8");
  HttpResponse response = httpclient.execute(httpPost);
  // Examine the response status
  System.out.println("Status " + response.getStatusLine());
  // Get hold of the response entity
  HttpEntity respEntity = response.getEntity();
  if (respEntity != null) {
   InputStream instream = respEntity.getContent();
   try {
    System.out.println("Output " + convertStreamToString(instream));
   } catch (Exception e) {
    e.printStackTrace();
   }
  }
  httpclient.getConnectionManager().shutdown();
 }

Output Trace:
 14:06:24(05/25) DEBUG DtrSec : [Thrd:qtp2476072-13]ENTERING: searchContent
- Start request processing
14:06:24(05/25) DEBUG org.apache.http.impl.conn.SingleClientConnManager :
Get connection for route HttpRoute[{}->http://localhost:9004]
14:06:24(05/25) DEBUG org.apache.http.client.protocol.RequestAddCookies :
CookieSpec selected: best-match
14:06:24(05/25) DEBUG org.apache.http.impl.client.DefaultHttpClient :
Attempt 1 to execute request
14:06:24(05/25) DEBUG org.apache.http.impl.conn.DefaultClientConnection :
Sending request: POST /search.xqy?docMin=1&docMax=15600 HTTP/1.1
14:06:24(05/25) DEBUG org.apache.http.wire : >> "POST
/search.xqy?docMin=1&docMax=15600 HTTP/1.1[EOL]"
14:06:24(05/25) DEBUG org.apache.http.wire : >> "Content-Type: text/plain;
charset=UTF-8[EOL]"
14:06:24(05/25) DEBUG org.apache.http.wire : >> "Content-Length: 71[EOL]"
14:06:24(05/25) DEBUG org.apache.http.wire : >> "Host: localhost:9004[EOL]"
14:06:24(05/25) DEBUG org.apache.http.wire : >> "Connection:
Keep-Alive[EOL]"
14:06:24(05/25) DEBUG org.apache.http.wire : >> "User-Agent:
Apache-HttpClient/4.0.1 (java 1.5)[EOL]"
14:06:24(05/25) DEBUG org.apache.http.wire : >> "Expect: 100-Continue[EOL]"
14:06:24(05/25) DEBUG org.apache.http.wire : >> "[EOL]"
14:06:24(05/25) DEBUG org.apache.http.headers : >> POST
/search.xqy?docMin=1&docMax=15600 HTTP/1.1
14:06:24(05/25) DEBUG org.apache.http.headers : >> Content-Type: text/plain;
charset=UTF-8
14:06:24(05/25) DEBUG org.apache.http.headers : >> Content-Length: 71
14:06:24(05/25) DEBUG org.apache.http.headers : >> Host: localhost:9004
14:06:24(05/25) DEBUG org.apache.http.headers : >> Connection: Keep-Alive
14:06:24(05/25) DEBUG org.apache.http.headers : >> User-Agent:
Apache-HttpClient/4.0.1 (java 1.5)
14:06:24(05/25) DEBUG org.apache.http.headers : >> Expect: 100-Continue
14:06:26(05/25) DEBUG org.apache.http.wire : >>
"('chap1','chap2','chap3','chap4')"
14:06:26(05/25) DEBUG org.apache.http.wire : << "HTTP/1.1 401
Unauthorized[EOL]"
14:06:26(05/25) DEBUG org.apache.http.wire : << "WWW-Authenticate: Digest
realm="public", qop="auth", nonce="66731c55c20e1c35f1ae38aed8e85169",
opaque="6f04e4536c7886af"[EOL]"
14:06:26(05/25) DEBUG org.apache.http.wire : << "Content-Type: text/html;
charset=utf-8[EOL]"
14:06:26(05/25) DEBUG org.apache.http.wire : << "Server: MarkLogic[EOL]"
14:06:26(05/25) DEBUG org.apache.http.wire : << "Content-Length: 209[EOL]"
14:06:26(05/25) DEBUG org.apache.http.wire : << "Connection:
Keep-Alive[EOL]"
14:06:26(05/25) DEBUG org.apache.http.wire : << "Keep-Alive: timeout=1,
max=96[EOL]"
14:06:26(05/25) DEBUG org.apache.http.wire : << "[EOL]"
14:06:26(05/25) DEBUG org.apache.http.impl.conn.DefaultClientConnection :
Receiving response: HTTP/1.1 401 Unauthorized
14:06:26(05/25) DEBUG org.apache.http.headers : << HTTP/1.1 401 Unauthorized
14:06:26(05/25) DEBUG org.apache.http.headers : << WWW-Authenticate: Digest
realm="public", qop="auth", nonce="66731c55c20e1c35f1ae38aed8e85169",
opaque="6f04e4536c7886af"
14:06:26(05/25) DEBUG org.apache.http.headers : << Content-Type: text/html;
charset=utf-8
14:06:26(05/25) DEBUG org.apache.http.headers : << Server: MarkLogic
14:06:26(05/25) DEBUG org.apache.http.headers : << Content-Length: 209
14:06:26(05/25) DEBUG org.apache.http.headers : << Connection: Keep-Alive
14:06:26(05/25) DEBUG org.apache.http.headers : << Keep-Alive: timeout=1,
max=96
14:06:26(05/25) DEBUG org.apache.http.impl.client.DefaultHttpClient :
Connection can be kept alive for 1000 ms
14:06:26(05/25) DEBUG org.apache.http.impl.client.DefaultHttpClient : Target
requested authentication
14:06:26(05/25) DEBUG
org.apache.http.impl.client.DefaultTargetAuthenticationHandler :
Authentication schemes in the order of preference: [ntlm, digest, basic]
14:06:26(05/25) DEBUG
org.apache.http.impl.client.DefaultTargetAuthenticationHandler : Challenge
for ntlm authentication scheme not available
14:06:26(05/25) DEBUG
org.apache.http.impl.client.DefaultTargetAuthenticationHandler : digest
authentication scheme selected
14:06:26(05/25) DEBUG org.apache.http.impl.client.DefaultHttpClient :
Authorization challenge processed
14:06:26(05/25) DEBUG org.apache.http.impl.client.DefaultHttpClient :
Authentication scope: DIGEST 'public'@localhost:9004
14:06:26(05/25) DEBUG org.apache.http.impl.client.DefaultHttpClient : Found
credentials
14:06:26(05/25) DEBUG org.apache.http.wire : << "<html xmlns="
http://www.w3.org/1999/xhtml";>[\n <http://www.w3.org/1999/xhtml%22%3E[/n>]"
14:06:26(05/25) DEBUG org.apache.http.wire : << "  <head>[\n]"
14:06:26(05/25) DEBUG org.apache.http.wire : << "    <title>401
Unauthorized</title>[\n]"
14:06:26(05/25) DEBUG org.apache.http.wire : << "    <meta name="robots"
content="noindex,nofollow"/>[\n]"
14:06:26(05/25) DEBUG org.apache.http.wire : << "  </head>[\n]"
14:06:26(05/25) DEBUG org.apache.http.wire : << "  <body>[\n]"
14:06:26(05/25) DEBUG org.apache.http.wire : << "    <h1>401
Unauthorized</h1>[\n]"
14:06:26(05/25) DEBUG org.apache.http.wire : << "  </body>[\n]"
14:06:26(05/25) DEBUG org.apache.http.wire : << "</html>[\n]"
14:06:26(05/25) DEBUG org.apache.http.client.protocol.RequestAddCookies :
CookieSpec selected: best-match
14:06:26(05/25) DEBUG org.apache.http.impl.client.DefaultHttpClient :
Attempt 2 to execute request
14:06:26(05/25) DEBUG org.apache.http.impl.conn.DefaultClientConnection :
Sending request: POST /search.xqy?docMin=1&docMax=15600 HTTP/1.1
14:06:26(05/25) DEBUG org.apache.http.wire : >> "POST
/search.xqy?docMin=1&docMax=15600 HTTP/1.1[EOL]"
14:06:26(05/25) DEBUG org.apache.http.wire : >> "Content-Type: text/plain;
charset=UTF-8[EOL]"
14:06:26(05/25) DEBUG org.apache.http.wire : >> "Content-Length: 71[EOL]"
14:06:26(05/25) DEBUG org.apache.http.wire : >> "Host: localhost:9004[EOL]"
14:06:26(05/25) DEBUG org.apache.http.wire : >> "Connection:
Keep-Alive[EOL]"
14:06:26(05/25) DEBUG org.apache.http.wire : >> "User-Agent:
Apache-HttpClient/4.0.1 (java 1.5)[EOL]"
14:06:26(05/25) DEBUG org.apache.http.wire : >> "Expect: 100-Continue[EOL]"
14:06:26(05/25) DEBUG org.apache.http.wire : >> "Authorization: Digest
username="admin", realm="public", nonce="66731c55c20e1c35f1ae38aed8e85169",
uri="/search.xqy?docMin=1&docMax=15600",
response="79a6d4cdf3b9006beaf2c55f4c5e1d89", qop=auth, nc=00000001,
cnonce="46a5ac2543e139b6a89bc59286d151e1", opaque="6f04e4536c7886af"[EOL]"
14:06:26(05/25) DEBUG org.apache.http.wire : >> "[EOL]"
14:06:26(05/25) DEBUG org.apache.http.headers : >> POST
/search.xqy?docMin=1&docMax=15600 HTTP/1.1
14:06:26(05/25) DEBUG org.apache.http.headers : >> Content-Type: text/plain;
charset=UTF-8
14:06:26(05/25) DEBUG org.apache.http.headers : >> Content-Length: 71
14:06:26(05/25) DEBUG org.apache.http.headers : >> Host: localhost:9004
14:06:26(05/25) DEBUG org.apache.http.headers : >> Connection: Keep-Alive
14:06:26(05/25) DEBUG org.apache.http.headers : >> User-Agent:
Apache-HttpClient/4.0.1 (java 1.5)
14:06:26(05/25) DEBUG org.apache.http.headers : >> Expect: 100-Continue
14:06:26(05/25) DEBUG org.apache.http.headers : >> Authorization: Digest
username="admin", realm="public", nonce="66731c55c20e1c35f1ae38aed8e85169",
uri="/search.xqy?docMin=1&docMax=15600",
response="79a6d4cdf3b9006beaf2c55f4c5e1d89", qop=auth, nc=00000001,
cnonce="46a5ac2543e139b6a89bc59286d151e1", opaque="6f04e4536c7886af"
14:06:28(05/25) DEBUG org.apache.http.wire : >>
"('chap1','chap2','chap3','chap4')"
14:06:28(05/25) DEBUG org.apache.http.wire : << "HTTP/1.1 200 OK[EOL]"
14:06:28(05/25) DEBUG org.apache.http.wire : << "Server: MarkLogic[EOL]"
14:06:28(05/25) DEBUG org.apache.http.wire : << "Content-Length: 0[EOL]"
14:06:28(05/25) DEBUG org.apache.http.wire : << "Connection:
Keep-Alive[EOL]"
14:06:28(05/25) DEBUG org.apache.http.wire : << "Keep-Alive: timeout=1,
max=96[EOL]"
14:06:28(05/25) DEBUG org.apache.http.wire : << "[EOL]"
14:06:28(05/25) DEBUG org.apache.http.impl.conn.DefaultClientConnection :
Receiving response: HTTP/1.1 200 OK
14:06:28(05/25) DEBUG org.apache.http.headers : << HTTP/1.1 200 OK
14:06:28(05/25) DEBUG org.apache.http.headers : << Server: MarkLogic
14:06:28(05/25) DEBUG org.apache.http.headers : << Content-Length: 0
14:06:28(05/25) DEBUG org.apache.http.headers : << Connection: Keep-Alive
14:06:28(05/25) DEBUG org.apache.http.headers : << Keep-Alive: timeout=1,
max=96
14:06:28(05/25) DEBUG org.apache.http.impl.client.DefaultHttpClient :
Connection can be kept alive for 1000 ms
Status HTTP/1.1 200 OK
14:06:28(05/25) DEBUG org.apache.http.impl.conn.SingleClientConnManager :
Releasing connection
org.apache.http.impl.conn.singleclientconnmanager$connadap...@ec835f
*Output*
14:06:28(05/25) DEBUG org.apache.http.impl.conn.DefaultClientConnection :
Connection shut down
14:06:28(05/25) DEBUG DtrSec : [Thrd:qtp2476072-13]EXITING: searchContent -
End request processing

The output is empty, when I try processing the above code.
However if I initialize the chapterNames in the xqy file itself, then I am
able to get back required response.
There is some error in the way the chapterNames variable is set or value
passed for the cts:element-attribute-value-query.
Request your help in identifying the error.

Thanks,
Radhika.


On Wed, May 19, 2010 at 9:57 PM, Michael Blakeley <
michael.blake...@marklogic.com> wrote:

> Those value cache misses are not a problem. The value cache is a per-query
> atomization cache, so it starts over on every query and misses are to be
> expected.
>
> Here is a query that doesn't touch the database at all, but the
> query-meters output still shows the value cache in action.
>
> let $a := <x id="1"/>
> for $i in 1 to 10
> return data($a/@id)
> , xdmp:query-meters()
>
> Change the '10' to 5, and watch the query-meters output.
>
> -- Mike
>
> On 2010-05-19 04:26, Vedavalli Radhika wrote:
>
>>  Thanks Geert,
>> The suggestions helped us to fine-tune the query.
>> Searching for chapter names is part of our requirement.
>>
>> Current query:
>> for $a in cts:search(collection("collection_name"),
>> cts:and-query((cts:element-attribute-range-query(xs:QName("book"),
>> xs:QName("length"), ">=", 26),
>> cts:element-attribute-range-query(xs:QName("book"), xs:QName("length"),
>> "<=", 2620), cts:element-attribute-value-query(xs:QName("chapter"),
>> xs:QName("name"), ('chap1','chap2','chap3','chap4')))), ("score-simple"))
>>
>> The query change has improved performance by considerable numbers.
>> However running query-meter for the search query, gives back cache-misses
>> for value cache.
>> I am unable to understand where my query went wrong?
>>
>> The results are for a 10MB input file.
>>
>> Query-trace is also attached.
>> We have defined two range element attribute indexes(for chapter,name and
>> book,length) in the marklogic server.
>>
>> -<qm:query-meters xsi:schemaLocation="
>> http://marklogic.com/xdmp/query-meters query-meters.xsd" xmlns:qm="
>> http://marklogic.com/xdmp/query-meters"; xmlns:xsi="
>> http://www.w3.org/2001/XMLSchema-instance";>
>>   <qm:elapsed-time>PT2.369S</qm:elapsed-time>
>>   <qm:requests>0</qm:requests>
>>   <qm:list-cache-hits>264098</qm:list-cache-hits>
>>   <qm:list-cache-misses>0</qm:list-cache-misses>
>>   <qm:in-memory-list-hits>0</qm:in-memory-list-hits>
>>   <qm:expanded-tree-cache-hits>1</qm:expanded-tree-cache-hits>
>>   <qm:expanded-tree-cache-misses>0</qm:expanded-tree-cache-misses>
>>   <qm:compressed-tree-cache-hits>0</qm:compressed-tree-cache-hits>
>>   <qm:compressed-tree-cache-misses>0</qm:compressed-tree-cache-misses>
>>   <qm:in-memory-compressed-tree-hits>0</qm:in-memory-compressed-tree-hits>
>>   <qm:value-cache-hits>1</qm:value-cache-hits>
>>   <qm:value-cache-misses>1</qm:value-cache-misses>
>>   <qm:regexp-cache-hits>0</qm:regexp-cache-hits>
>>   <qm:regexp-cache-misses>0</qm:regexp-cache-misses>
>>   <qm:link-cache-hits>0</qm:link-cache-hits>
>>   <qm:link-cache-misses>0</qm:link-cache-misses>
>>   <qm:filter-hits>1</qm:filter-hits>
>>   <qm:filter-misses>0</qm:filter-misses>
>>   <qm:fragments-added>0</qm:fragments-added>
>>   <qm:fragments-deleted>0</qm:fragments-deleted>
>>   <qm:fs-program-cache-hits>0</qm:fs-program-cache-hits>
>>   <qm:fs-program-cache-misses>0</qm:fs-program-cache-misses>
>>   <qm:db-program-cache-hits>0</qm:db-program-cache-hits>
>>   <qm:db-program-cache-misses>0</qm:db-program-cache-misses>
>>
>> <qm:fs-main-module-sequence-cache-hits>0</qm:fs-main-module-sequence-cache-hits>
>>
>> <qm:fs-main-module-sequence-cache-misses>0</qm:fs-main-module-sequence-cache-misses>
>>
>> <qm:db-main-module-sequence-cache-hits>0</qm:db-main-module-sequence-cache-hits>
>>
>> <qm:db-main-module-sequence-cache-misses>0</qm:db-main-module-sequence-cache-misses>
>>   <qm:fs-library-module-cache-hits>0</qm:fs-library-module-cache-hits>
>>   <qm:fs-library-module-cache-misses>0</qm:fs-library-module-cache-misses>
>>   <qm:db-library-module-cache-hits>0</qm:db-library-module-cache-hits>
>>   <qm:db-library-module-cache-misses>0</qm:db-library-module-cache-misses>
>> -<qm:fragments>
>> -<qm:fragment>
>>   <qm:root>book</qm:root>
>>   <qm:expanded-tree-cache-hits>1</qm:expanded-tree-cache-hits>
>>   <qm:expanded-tree-cache-misses>0</qm:expanded-tree-cache-misses>
>>   </qm:fragment>
>>   </qm:fragments>
>> -<qm:documents>
>> -<qm:document>
>>   <qm:uri>testbook</qm:uri>
>>   <qm:expanded-tree-cache-hits>1</qm:expanded-tree-cache-hits>
>>   <qm:expanded-tree-cache-misses>0</qm:expanded-tree-cache-misses>
>>   </qm:document>
>>   </qm:documents>
>>   </qm:query-meters>
>>
>> Results from query-trace
>>
>>  2010-05-19 12:54:37.876 Info: Http_Server: line 1:
>> xdmp:eval("xdmp:query-trace(true()),
>> cts:search(collection(&quot;collection_name&qu...", (),<options
>> xmlns="xdmp:eval"><root>C:\Program
>> Files\MarkLogic\Samples\cq</root><isolation>dif...</options>)
>> 2010-05-19 12:54:37.876 Info: Http_Server: line 1: Analyzing path for
>> search: fn:collection("collection_name")
>> 2010-05-19 12:54:37.876 Info: Http_Server: line 1: Step 1 is searchable:
>> fn:collection("collection_name")
>> 2010-05-19 12:54:37.876 Info: Http_Server: line 1: Path is fully
>> searchable.
>> 2010-05-19 12:54:37.876 Info: Http_Server: line 1: Gathering constraints.
>> 2010-05-19 12:54:37.876 Info: Http_Server: line 1: Step 1 contributed 1
>> constraint: fn:collection("collection_name")
>> 2010-05-19 12:54:39.431 Info: Http_Server: line 1: Comparison contributed
>> int range value constraint: book/@length<mailto:book/@length>  >= 48754
>> 2010-05-19 12:54:39.431 Info: Http_Server: line 1: Comparison contributed
>> int range value constraint: book/@length<mailto:book/@length>  <=
>> 487542500
>>
>> 2010-05-19 12:54:40.059 Info: Http_Server: line 1: Search query
>> contributed 2 constraints:
>> cts:and-query((cts:element-attribute-range-query(fn:QName("", "book"),
>> fn:QName("", "length"), ">=", 48754, (), 1),
>> cts:element-attribute-range-query(fn:QName("", "book"), fn:QName("",
>> "length"), "<=", 487542500, (), 1),
>> cts:element-attribute-value-query(fn:QName("", "chapter"), fn:QName("",
>> "name"), ("chap1", "chap2", "chap3", "chap4",....), ("lang=en"), 1)), ())
>> 2010-05-19 12:55:24.935 Info: Http_Server: line 1: Executing search.
>> 2010-05-19 12:55:25.240 Info: Http_Server: line 1: Selected 4 fragments to
>> filter
>>
>> Thanks,
>> Radhika
>>
>>
>>
>> Hi Radhika,
>>
>> Glancing through your query I notice some things. You have a nested
>> and-query, do you know that cts:and-query can take an sequence of any
>> length? And you have an or-query that tests the same element attribute value
>> over and over again, with different values. It should be possible to pass
>> one sequence with all allowed values to a single
>> cts:element-attribute-value-query, eliminating the need for the or-query
>> alltogether.
>>
>> Not sure why you are searching for specific chapter names though. Is that
>> necessary?
>>
>> Kind regards,
>> Geert
>>
>>
>>>
>> drs. G.P.H. (Geert) Josten
>> Consultant
>>
>> Daidalos BV
>> Hoekeindsehof 1-4
>> 2665 JZ Bleiswijk
>>
>> T +31 (0)10 850 1200
>> F +31 (0)10 850 1199
>>
>> mailto:geert.jos...@daidalos.nl
>> http://www.daidalos.nl/
>>
>> KvK 27164984
>>
>> P Please consider the environment before printing this mail.
>> De informatie - verzonden in of met dit e-mailbericht - is afkomstig van
>> Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit
>> bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan
>> dit bericht kunnen geen rechten worden ontleend.
>>
>>  From: general-boun...@developer.marklogic.com<mailto:
>>> general-boun...@developer.marklogic.com>
>>> [mailto:general-boun...@developer.marklogic.com<mailto:
>>> general-boun...@developer.marklogic.com>] On Behalf Of
>>>
>>> Vedavalli Radhika
>>> Sent: maandag 17 mei 2010 13:53
>>> To: general@developer.marklogic.com<mailto:
>>> general@developer.marklogic.com>
>>>
>>> Subject: [MarkLogic Dev General] Performance Tuning -
>>> cts:search/cts:or Query
>>>
>>> We have a requirement for searching the marklogic database
>>> for documents that satisfies a specific condition - length
>>> attribute value should be within the specified range and one
>>> or more chapters from the given chapters should be available.
>>> The searched information is then filtered based on a fitness
>>> calculation.
>>> The execution of the query takes a long time if the dynamic
>>> or-query becomes long (for bigger inputs, the or-query formed
>>> will be longer) Are there better ways to optimize this search
>>> query or atleast the or-query alone?
>>>
>>> QUERY:
>>> for $a in
>>> cts:search(collection(),
>>> cts:and-query(
>>> (
>>> cts:and-query(
>>> (cts:element-attribute-range-query(xs:QName("book"),
>>> xs:QName("length"), ">=", 26),
>>> cts:element-attribute-range-query(xs:QName("book"),
>>> xs:QName("length"), "<=", 2620)) ), cts:or-query( (
>>> cts:element-attribute-value-query(xs:QName("chapter"),
>>> xs:QName("name"), "chap6"),
>>> cts:element-attribute-value-query(xs:QName("chapter"),
>>> xs:QName("name"), "newChap"),
>>> cts:element-attribute-value-query(xs:QName("chapter"),
>>> xs:QName("name"), "chap2"),
>>> cts:element-attribute-value-query(xs:QName("chapter"),
>>> xs:QName("name"), "chap5"),
>>> cts:element-attribute-value-query(xs:QName("chapter"),
>>> xs:QName("name"), "chap3"),
>>> cts:element-attribute-value-query(xs:QName("chapter"),
>>> xs:QName("name"), "chap9"),
>>> cts:element-attribute-value-query(xs:QName("chapter"),
>>> xs:QName("name"), "chap1"),
>>> cts:element-attribute-value-query(xs:QName("chapter"),
>>> xs:QName("name"), "chap4"))
>>> )
>>> )
>>> ), ("score-simple"))
>>> where $a[(cts:score($a))div(8*($a/book/@chapCnt<mailto:$a/book/@chapCnt>))
>>> ge 0.1]
>>>
>>> return element hit { attribute score { cts:score($a) }, $a }
>>> SAMPLE DOCUMENT IN MARKLOGIC:
>>>  <book author="Author" length="262" id="unique-id" chapCnt="4">
>>>   <chapter pageStart="5" name="chap1" pageEnd="80" />
>>>   <chapter pageStart="83" name="chap2" pageEnd="180" />
>>>   <chapter pageStart="182" name="chap3" pageEnd="401" />
>>>   <chapter pageStart="405" name="chap4" pageEnd="567" />
>>>   </book>
>>>
>>> Thanks,
>>> Radhika
>>>
>>>
>>>
>>
>
_______________________________________________
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to