Hi, Martin:

As Geert points out, QBE does focus on the case where the input
is an annotated example of the document to match.

That said, it is possible to give express queries against JSON properties
or unnamespaced XML elements in either format:

    http://docs.marklogic.com/guide/search-dev/qbe#id_26341

It is not possible to query both formats in either format.  That's
a good RFE.


Erik Hennum

________________________________________
From: [email protected] 
[[email protected]] on behalf of Geert Josten 
[[email protected]]
Sent: Tuesday, June 23, 2015 6:47 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Confusion about REST API results

Well, it *is* Query By Example, so that would make perfect sense.. :-)

On the other hand the distinction between elements and json-properties
isn¹t always equally clear in MarkLogic. Element indexes also work on json
properties for instance..

Cheers,
Geert

On 6/23/15, 3:00 PM, "Martin Vollmix" <[email protected]> wrote:

>
>I think I found the explanation myself.
>
>qbe Queries in JSON only retrieve JSON Documents and qbe Queries in XML
>only
>retrieve XML Documents
>
>Am I right?
>
>Martin
>
>-----Ursprüngliche Nachricht-----
>Von: [email protected]
>[mailto:[email protected]] Im Auftrag von Martin
>Vollmix
>Gesendet: Dienstag, 23. Juni 2015 14:33
>An: 'MarkLogic Developer Discussion'
>Betreff: [MarkLogic Dev General] Confusion about REST API results
>
>Hi,
>
>I have one JSON and one XML Document in my Database and both of them have
>a
>key named manufacturer:
>
><?xml version="1.0" encoding="UTF-8"?>
><cars>
>       <manufacturer>"BMW"</manufacturer>
>       <model>"335i"</model>
>       <power>272</power>
>       <maxspeed>245</maxspeed>
></cars>
>
>And
>
>{
>       manufacturer:  "BMW",
>       model:  "530d",
>       power: 231,
>       maxspeed: 240
>}
>
>Now I did a REST search like this
>http://localhost:8003/v1/search?q=BMW&format=json
>I get back 2 hits as expected
>
>But if I do a qbe query like this:
>http://localhost:8003/v1/qbe?format=json
>with
>{
>       $query: {
>       $word: "BMW"
>    }
>}
>
>The result is only one hit for the JSON Document
>
>Any Explanation?
>
>Thanks in advance
>
>Martin
>_______________________________________________
>General mailing list
>[email protected]
>Manage your subscription at:
>http://developer.marklogic.com/mailman/listinfo/general
>_______________________________________________
>General mailing list
>[email protected]
>Manage your subscription at:
>http://developer.marklogic.com/mailman/listinfo/general

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

Reply via email to