Skip to content

JSON QBE search broken #29

@kcoleman-marklogic

Description

@kcoleman-marklogic

If I try to perform a search with a QBE expressed as JSON, the Java API chokes on the search results, saying "Could not construct search results: parser error". Poking at it using XML and using string results, I think the problem is the results are coming back as JSON and the client lib doesn't know what to do with them.

In the past, search results always came back as XML, regardless of the query format. Currently, the results seem to come back as JSON if the quer is JSON, but you cannot set the SearchHandle format to JSON. If you try, withFormat() yells at you that search results are always in XML.

All this might be expected, given the current state of things, so I'm not sure it is a bug rather than just something no one has gotten around to yet, but I figured I might as well file it.

Error below, sample code in next comment.

Exception in thread "main" com.marklogic.client.MarkLogicIOException: Could not construct search results: parser error
at com.marklogic.client.io.SearchHandle.receiveContent(SearchHandle.java:183)
at com.marklogic.client.io.SearchHandle.receiveContent(SearchHandle.java:1)
at com.marklogic.client.impl.QueryManagerImpl.search(QueryManagerImpl.java:199)
at com.marklogic.client.impl.QueryManagerImpl.search(QueryManagerImpl.java:162)
at examples.bug.jsonQBE(bug.java:50)
at examples.bug.main(bug.java:59)
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: Content is not allowed in prolog.
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(Unknown Source)
at com.sun.xml.internal.stream.XMLEventReaderImpl.nextEvent(Unknown Source)
at com.marklogic.client.io.SearchHandle$SearchResponseImpl.parse(SearchHandle.java:982)
at com.marklogic.client.io.SearchHandle$SearchResponseImpl.access$1(SearchHandle.java:978)
at com.marklogic.client.io.SearchHandle.receiveContent(SearchHandle.java:158)
... 5 more

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions