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]>wrote:

> Thanks Erik for the information. I get it.
>
> Regards,
> Sini
>
>
> On Wed, Jun 26, 2013 at 5:23 PM, Erik Hennum <[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] [
>> [email protected]] on behalf of sini narayanan [
>> [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]
>> http://developer.marklogic.com/mailman/listinfo/general
>>
>>
>
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to