Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building a query with the extract-document-data element specified in the query options causes Warn level messages to be logged #423

Closed
ableasdale opened this issue Jul 7, 2016 · 4 comments

Comments

@ableasdale
Copy link

ableasdale commented Jul 7, 2016

Currently if a query is being created that makes use of "extract-document-data":

<extract-document-data selected="all">
  <extract-path>//*:metadata</extract-path>
  <extract-path>//document[@xml:lang='en']/standard</extract-path>
</extract-document-data>

The query yields a valid response from MarkLogic Server but the SearchHandle object in the Java API renders a Warn level Log message:

Unexpected metrics element {http://marklogic.com/appservices/search}extract-resolution-time

The message makes a reference to line 1536 of the class src/main/java/com/marklogic/client/io/SearchHandle.java. In the code, there is a section that looks like this:

            QName queryName    = new QName(SEARCH_NS, "query-resolution-time");
            QName facetName    = new QName(SEARCH_NS, "facet-resolution-time");
            QName snippetName  = new QName(SEARCH_NS, "snippet-resolution-time");
            QName metadataName = new QName(SEARCH_NS, "metadata-resolution-time");
            QName totalName    = new QName(SEARCH_NS, "total-time");

This appears to be missing a line like this:

          QName extractName  = new QName(SEARCH_NS, "extract-resolution-time");

These lines appear to be checking the query resultset to identify all search:search metrics based elements, such as "query-resolution-time".

Currently, it appears to be the case that the "extract-resolution-time" element is missing from this list; this element should be added to the enumeration in line 1504 to 1508 and further changes may need to be made in the client API.

An initial attempt to fix this can be found at:
ableasdale@93fb090

At this stage, it appears that this change alone may not be enough...

@sammefford sammefford added this to the java-client-api-4.0-ea3 milestone Jul 7, 2016
@sammefford sammefford self-assigned this Jul 7, 2016
sammefford added a commit that referenced this issue Jul 7, 2016
… and SearchMetrics; deprecate SearchMetrics.getMetadataResolutionTime; fix indenting in StrinSearchTest to be spaces with no tabs mixed in
@sammefford sammefford added test and removed fix labels Jul 7, 2016
@sammefford
Copy link
Contributor

Alex, since this fix only involved removing a faulty WARN message from the logging, I'm guessing it is enough to fix this on the develop branch (ML 9+). Is that correct?

@sammefford
Copy link
Contributor

I should note that as part of this fix I added a method to SearchMetrics called getExtractResolutionTime(). Since the metric is available in the search response, it makes sense to surface it with the other metrics.

@ableasdale
Copy link
Author

Hi Sam,

For now, I think fixing it in the develop branch should be fine. I'll let you know if I hear otherwise. Thanks again for your help with this yesterday.

@sammefford sammefford removed their assignment Aug 15, 2016
@georgeajit georgeajit added ship and removed test labels Aug 29, 2016
@georgeajit
Copy link
Contributor

Test works fine.

sammefford added a commit that referenced this issue Jan 13, 2017
… and SearchMetrics; deprecate SearchMetrics.getMetadataResolutionTime; fix indenting in StrinSearchTest to be spaces with no tabs mixed in

(cherry picked from commit d852f3b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants