Thanks kelly  for your reply ! why I do not want to go for custom query or 
custom constraint is because field search is faster over the same element 
search . Marklogic perform search over the subset of database indexes 
created over the fields only. So we can assume the search is done over the 
part of database indexes rather than over the entire database indexes.

Abhishek Srivastav
Assistant Systems Engineer
Tata Consultancy Services
Plot  B-1, Block EP & GP, Sector 5
Salt Lake Electronics Complex,
Kolkata - 700 091,West Bengal
India
Cell:- +91-9883389968
Mailto: [email protected]
Website: http://www.tcs.com
____________________________________________
Experience certainty.   IT Services
                        Business Solutions
                        Outsourcing
____________________________________________



From:
Kelly Stirman <[email protected]>
To:
"[email protected]" <[email protected]>
Date:
05/04/2011 07:11 PM
Subject:
Re: [MarkLogic Dev General] Field creation over attribute value
Sent by:
[email protected]



You cannot do this with a field in MarkLogic, but you can use 
cts:element-attribute-word-query with query weights to accomplish 
something equivalent.

cts:or-query((
 
cts:element-attribute-word-query(xs:QName("element1"),xs:QName("attribute1"),$text,(),2.0),
 
cts:element-attribute-word-query(xs:QName("element2"),xs:QName("attribute2"),$text,(),1.0),
 
cts:element-attribute-word-query(xs:QName("element3"),xs:QName("attribute3"),$text,(),0.5)
))

Kelly

Message: 3
Date: Wed, 4 May 2011 16:03:21 +0530
From: Abhishek53 S <[email protected]>
Subject: Re: [MarkLogic Dev General] Field creation over attribute
                 value
To: General MarkLogic Developer Discussion
                 <[email protected]>
Message-ID:
 <of9c60e3c4.06c9e738-on65257886.003940ab-65257886.003a1...@tcs.com>
Content-Type: text/plain; charset="iso-8859-1"

Yes Gajanan ! But the problem is there element-attribute-value all three 
combines to form the field. There is no option (in my knowledge) to create 
field based on the element-attribute (not attribute value) pair only. I 
have the limitation of not to restructure the content. 

Scenario:
I want is to extract <test attr="kolkata" >west</test> the value of "attr" 

to use for the field word. Can It be done in other ways without adding 
extra element into the content ( Attribute can be added)?


Thanks & Regards

Abhishek Srivastav
Assistant Systems Engineer
Tata Consultancy Services
Plot  B-1, Block EP & GP, Sector 5
Salt Lake Electronics Complex,
Kolkata - 700 091,West Bengal
India
Cell:- +91-9883389968
Mailto: [email protected]
Website: http://www.tcs.com
____________________________________________
Experience certainty.   IT Services
                        Business Solutions
                        Outsourcing
____________________________________________
_______________________________________________
General mailing list
[email protected]
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
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to