Sini,

Sorry to be late on the uptake on this one.

If we back up to your original question, I *think* what you're saying is that 
if you have a collection constraint defined that has a prefix ("/provider/"), 
you would expect the metadata extracted for that document using that constraint 
reference to be only collections under that prefix, not all collections for 
that document.

Is that what you were confused by, and hoping to fix?

If you confirm that's the case, then I think the answer is that there's a bug 
in the Search API, and we can file that so that it can be fixed.  What version 
are you running?

--Colleen

________________________________
From: [email protected] 
[[email protected]] on behalf of sini narayanan 
[[email protected]]
Sent: Thursday, June 27, 2013 4:36 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Maklogic : get collection Search Metadata

Hi Eric,

How can I get the node name of a particular constraint from the search that I 
perform?
for example:
I have a json query, I perform a json:transform-from-json on the query and then 
perform a search:resolve on the query with options.

let $jsonQry   := 
'{"query":{"and-query":{"queries":[{"collection-constraint-query":{"constraint-name":"type","uri":["flower"]}}]}}}'
let $query     := json:transform-from-json($jsonQry,$sut:json-config-query)
let $globalQry := search:resolve($query, $options) (:all the options specified:)
return
$globalQry

Here the $globalQry would return all the search:metadata nodes and the 
searc:facet nodes [for all the constraints configured in my options].
So for each of the element/attribute, I can get the possible values.

Similar way, how do I get the node name of a particular node. Will path range 
index configuration help?
How do I add a constraint to get the node value in $options?


Thanks,
Sini


On Wed, Jun 26, 2013 at 5:27 PM, sini narayanan 
<[email protected]<mailto:[email protected]>> wrote:
Thanks Erik for the information. I get it.

Regards,
Sini


On Wed, Jun 26, 2013 at 5:23 PM, Erik Hennum 
<[email protected]<mailto:[email protected]>> wrote:
Hi, Sini:

The term "metadata" may have created an unhelpful expectation.

In the Search API, metadata extraction gets nodes from the content of the 
result document other than the nodes matched by the query criteria.  It's 
called "metadata" because it's often general information such as the identifier 
or title.

Thus, when extracting metadata, the query options can specify only a XML 
element or attribute, JSON key, or field (whether directly or indirectly by 
reference to a constraint).  A collection does not appear in the content of a 
document, so the query options can't extract a collection as metadata.

Also, a collection is just a tag associated with one or more documents.  A 
collection has no metadata to extract.

Can you expand a bit about the goal here?


Erik Hennum

________________________________
From: 
[email protected]<mailto:[email protected]>
 
[[email protected]<mailto:[email protected]>]
 on behalf of sini narayanan 
[[email protected]<mailto:[email protected]>]
Sent: Wednesday, June 26, 2013 3:11 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Maklogic : get collection Search Metadata

Hi All,

I'm performing a search:resolve operation on a query with options which include 
a collection constraint as below.

<search:constraint name="provider">
    <search:collection prefix="/provider/" facet="true">
      <search:facet-option>frequency-order</search:facet-option>
      <search:facet-option>limit=10</search:facet-option>
    </search:collection>
    <search:annotation><proj:front-page 
xmlns:proj="http://marklogic.com/appservices/project"/><proj:side-bar 
xmlns:proj="http://marklogic.com/appservices/project";>true</proj:side-bar></search:annotation>
</search:constraint>


How do I get the search:metadata for the collection "provider"?
I have included the below node in the options.
<search:extract-metadata>
  <search:constraint-value ref="provider"/>
</search:extract-metadata>

I get the result with all the collection details that exist for the search doc.

Thanks,
Sini

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



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

Reply via email to