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

Minor issue -- a misleading WARN log message. #241

Closed
grechaw opened this issue Jan 8, 2015 · 3 comments
Closed

Minor issue -- a misleading WARN log message. #241

grechaw opened this issue Jan 8, 2015 · 3 comments

Comments

@grechaw
Copy link
Contributor

grechaw commented Jan 8, 2015

If I call values with a JSON handle, then for some reason the getCollections() method on query definition returns an empty array rather than null.

I think the test is just wrong in JerseyServices, line 2353 or thereabouts:

            if (queryDef.getCollections() != null) {
                if (logger.isWarnEnabled())
                    logger.warn("collections scope ignored for values query");
            }

This needs to be a non-empty test in addition to or instead of this null test. I'm not sure which.

There is a (also minor) bug blocked in samplestack marklogic-community/marklogic-samplestack#383

@sammefford sammefford added this to the 8.0-2 milestone Jan 12, 2015
@sammefford sammefford self-assigned this Jan 12, 2015
@grechaw
Copy link
Contributor Author

grechaw commented Jan 12, 2015

This is the code that exposes this bug:

DateTime[] dates = new DateTime[2];
        QueryManager queryManager = clients.get(role).newQueryManager();
        ValuesDefinition valdef = queryManager
                .newValuesDefinition("lastActivityDate");
        valdef.setAggregate("min", "max");
        valdef.setView("aggregate");
        JacksonHandle handle = new JacksonHandle();
        handle.set(structuredQuery);
        RawCombinedQueryDefinition qdef = queryManager
                .newRawCombinedQueryDefinition(handle, QUESTIONS_OPTIONS);
        valdef.setQueryDefinition(qdef);
        ValuesHandle responseHandle = null;
        try {
            responseHandle = queryManager.values(valdef, new ValuesHandle());
        } catch (com.marklogic.client.FailedRequestException ex) {
            throw new SamplestackSearchException(ex);
        }

Although nowhere is a collection set, somehow it ends up in Jersey Services as not null. I think a few minutes of debugging will show where the issue is.

@grechaw
Copy link
Contributor Author

grechaw commented Jan 12, 2015

And an options node that should work (the QueryOptionsManager method we used last week should work for this)

{"options":
 "values": [
            {
                "name": "lastActivityDate",
                "range": {
                    "json-property": "lastActivityDate",
                    "type": "xs:dateTime"
                }
            }
        ]
}

@sammefford
Copy link
Contributor

Sorry for the long delay on this. It's fixed now. Given how minor it is, let's skip additional testing.

@sammefford sammefford removed their assignment Mar 15, 2017
@sammefford sammefford added ship and removed new labels Mar 15, 2017
@sammefford sammefford added closed and removed ship labels May 3, 2017
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

2 participants