{"action":"created","issue":{"url":"https://api.github.com/repos/marklogic/Geophoto/issues/9","repository_url":"https://api.github.com/repos/marklogic/Geophoto","labels_url":"https://api.github.com/repos/marklogic/Geophoto/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/marklogic/Geophoto/issues/9/comments","events_url":"https://api.github.com/repos/marklogic/Geophoto/issues/9/events","html_url":"https://github.com/marklogic/Geophoto/issues/9","id":162277612,"number":9,"title":"map feature throws Bad Request 400 with msg SEARCH-BADORDERBY","user":{"login":"ouyi","id":15970333,"avatar_url":"https://avatars.githubusercontent.com/u/15970333?v=3","gravatar_id":"","url":"https://api.github.com/users/ouyi","html_url":"https://github.com/ouyi","followers_url":"https://api.github.com/users/ouyi/followers","following_url":"https://api.github.com/users/ouyi/following{/other_user}","gists_url":"https://api.github.com/users/ouyi/gists{/gist_id}","starred_url":"https://api.github.com/users/ouyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ouyi/subscriptions","organizations_url":"https://api.github.com/users/ouyi/orgs","repos_url":"https://api.github.com/users/ouyi/repos","events_url":"https://api.github.com/users/ouyi/events{/privacy}","received_events_url":"https://api.github.com/users/ouyi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-06-25T11:46:48Z","updated_at":"2016-11-11T11:09:02Z","closed_at":null,"body":"Hi,\n\nI got the following error when navigating to http://localhost:4000/#/map:\n\nError:  { [Error: query documents: response with invalid 400 status]\n  message: 'query documents: response with invalid 400 status',\n  statusCode: 400,\n  body: \n   { errorResponse: \n      { statusCode: 400,\n        status: 'Bad Request',\n        messageCode: 'SEARCH-BADORDERBY',\n        message: 'SEARCH-BADORDERBY: (err:FOER0000) Indexes are required to support element, element-attribute, json-property, or field sort specifications.' } },\n  stack: 'From previous event:\\n    at new Promise (/github/Geophoto/node_modules/marklogic/node_modules/bluebird/js/main/promise.js:87:37)\\n    at Operation.operationResultPromise (/Users/github/Geophoto/node_modules/marklogic/lib/mlrest.js:1452:17)\\n    at Object.callBackMethod [as result](/github/Geophoto/node_modules/marklogic/lib/mlutil.js:132:17)\\n    at selectAll (/github/Geophoto/routes.js:38:7)\\n    at apiindex (/github/Geophoto/routes.js:135:5)\\n    at Layer.handle [as handle_request](/github/Geophoto/node_modules/express/lib/router/layer.js:95:5)\\n    at next (/github/Geophoto/node_modules/express/lib/router/route.js:131:13)\\n    at Route.dispatch (/github/Geophoto/node_modules/express/lib/router/route.js:112:3)' }\n\nIt seems that \"order by\" is not working due to missing indexes. The sorting is likely done in this function in routes.js:\n\n```\nvar selectAll = function selectAll() {\n    return db.documents.query(\n      qb.where(\n        qb.collection('image')\n      )\n      .orderBy(\n        qb.sort('filename')\n      )\n      .slice(0,300) //return 300 documents \"per page\" (pagination)\n    ).result();\n};\n```\n\nI enabled ALL indexes via the Admin Interface for the database \"Documents\", but the error persists. Which indexes in which database shall be enabled for this?\n\nThanks!\n"},"comment":{"url":"https://api.github.com/repos/marklogic/Geophoto/issues/comments/259935252","html_url":"https://github.com/marklogic/Geophoto/issues/9#issuecomment-259935252","issue_url":"https://api.github.com/repos/marklogic/Geophoto/issues/9","id":259935252,"user":{"login":"tpiros","id":2042718,"avatar_url":"https://avatars.githubusercontent.com/u/2042718?v=3","gravatar_id":"","url":"https://api.github.com/users/tpiros","html_url":"https://github.com/tpiros","followers_url":"https://api.github.com/users/tpiros/followers","following_url":"https://api.github.com/users/tpiros/following{/other_user}","gists_url":"https://api.github.com/users/tpiros/gists{/gist_id}","starred_url":"https://api.github.com/users/tpiros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpiros/subscriptions","organizations_url":"https://api.github.com/users/tpiros/orgs","repos_url":"https://api.github.com/users/tpiros/repos","events_url":"https://api.github.com/users/tpiros/events{/privacy}","received_events_url":"https://api.github.com/users/tpiros/received_events","type":"User","site_admin":false},"created_at":"2016-11-11T11:09:01Z","updated_at":"2016-11-11T11:09:01Z","body":"@DineshGuptaa port 4000 is fine - can you let me know if you see any errors in your browser's console when you go to 'http://localhost:4000'? "}}
{"actor":{"display_login":"tpiros"}}