{"action":"created","issue":{"url":"https://api.github.com/repos/marklogic/java-client-api/issues/475","repository_url":"https://api.github.com/repos/marklogic/java-client-api","labels_url":"https://api.github.com/repos/marklogic/java-client-api/issues/475/labels{/name}","comments_url":"https://api.github.com/repos/marklogic/java-client-api/issues/475/comments","events_url":"https://api.github.com/repos/marklogic/java-client-api/issues/475/events","html_url":"https://github.com/marklogic/java-client-api/issues/475","id":175796056,"number":475,"title":"Cannot add a rule with a Not-query","user":{"login":"sastafford","id":524805,"avatar_url":"https://avatars.githubusercontent.com/u/524805?v=3","gravatar_id":"","url":"https://api.github.com/users/sastafford","html_url":"https://github.com/sastafford","followers_url":"https://api.github.com/users/sastafford/followers","following_url":"https://api.github.com/users/sastafford/following{/other_user}","gists_url":"https://api.github.com/users/sastafford/gists{/gist_id}","starred_url":"https://api.github.com/users/sastafford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sastafford/subscriptions","organizations_url":"https://api.github.com/users/sastafford/orgs","repos_url":"https://api.github.com/users/sastafford/repos","events_url":"https://api.github.com/users/sastafford/events{/privacy}","received_events_url":"https://api.github.com/users/sastafford/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-09-08T16:11:49Z","updated_at":"2016-09-08T19:52:05Z","closed_at":null,"body":"com.marklogic.client.FailedRequestException: Local message: /alert/rules write failed: Bad Request. Server Message: XDMP-ARGTYPE: (err:XPTY0004) cts:not-query(()) -- arg1 is not of type cts:query\r\n\r\n\tat com.marklogic.client.impl.JerseyServices.putPostValueImpl(JerseyServices.java:3031)\r\n\tat com.marklogic.client.impl.JerseyServices.putValue(JerseyServices.java:2881)\r\n\tat com.marklogic.client.impl.RuleManagerImpl.writeRule(RuleManagerImpl.java:168)\r\n\r\n```java\r\npublic void addQueryTest() {\r\n        StructuredQueryBuilder qb = new StructuredQueryBuilder(\"default\");\r\n        //StructuredQueryDefinition geoQueryRule = qb.not(qb.geospatialConstraint(\"geo\", qb.circle(90.0, 90.0, 5.0)));\r\n        String rawXMLQuery =\r\n                \"<query xmlns='http://marklogic.com/appservices/search'>\"+\r\n                    \"<not-query>\"+\r\n                        \"<geospatial-constraint-query>\"+\r\n                        \"<constraint-name>geo</constraint-name>\"+\r\n\t\t\t\t\t        \"<circle>\"+\r\n\t\t\t\t\t            \"<radius>3.5674162949999997</radius>\"+\r\n\t\t\t\t\t            \"<point>\"+\r\n\t\t\t\t\t                \"<latitude>-15.766</latitude>\"+\r\n\t\t\t\t\t                \"<longitude>33.829</longitude>\"+\r\n                        \t\t\"</point>\"+\r\n                            \"</circle>\"+\r\n                        \"</geospatial-constraint-query>\"+\r\n                    \"</not-query>\"+\r\n                \"</query>\";\r\n        StringHandle rawHandle = new StringHandle(rawXMLQuery);\r\n        RuleDefinition rule = new RuleDefinition(\"sample\", \"sample\");\r\n        //StringHandle queryHandle = new StringHandle(geoQueryRule.serialize());\r\n        rule.importQueryDefinition(rawHandle);\r\n        ruleMgr.writeRule(\"sample\", rule);\r\n    }\r\n```"},"comment":{"url":"https://api.github.com/repos/marklogic/java-client-api/issues/comments/245719030","html_url":"https://github.com/marklogic/java-client-api/issues/475#issuecomment-245719030","issue_url":"https://api.github.com/repos/marklogic/java-client-api/issues/475","id":245719030,"user":{"login":"sastafford","id":524805,"avatar_url":"https://avatars.githubusercontent.com/u/524805?v=3","gravatar_id":"","url":"https://api.github.com/users/sastafford","html_url":"https://github.com/sastafford","followers_url":"https://api.github.com/users/sastafford/followers","following_url":"https://api.github.com/users/sastafford/following{/other_user}","gists_url":"https://api.github.com/users/sastafford/gists{/gist_id}","starred_url":"https://api.github.com/users/sastafford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sastafford/subscriptions","organizations_url":"https://api.github.com/users/sastafford/orgs","repos_url":"https://api.github.com/users/sastafford/repos","events_url":"https://api.github.com/users/sastafford/events{/privacy}","received_events_url":"https://api.github.com/users/sastafford/received_events","type":"User","site_admin":false},"created_at":"2016-09-08T19:52:05Z","updated_at":"2016-09-08T19:52:05Z","body":"@kcoleman-marklogic - Yes, the query and options work fine on the /search endpoint"}}
{"actor":{"display_login":"sastafford"}}