{"action":"created","issue":{"url":"https://api.github.com/repos/fhirbase/fhirbase/issues/90","labels_url":"https://api.github.com/repos/fhirbase/fhirbase/issues/90/labels{/name}","comments_url":"https://api.github.com/repos/fhirbase/fhirbase/issues/90/comments","events_url":"https://api.github.com/repos/fhirbase/fhirbase/issues/90/events","html_url":"https://github.com/fhirbase/fhirbase/issues/90","id":66874579,"number":90,"title":"Search returns everything instead of empty result with wrong query","user":{"login":"szymonp-kainos","id":11288967,"avatar_url":"https://avatars.githubusercontent.com/u/11288967?v=3","gravatar_id":"","url":"https://api.github.com/users/szymonp-kainos","html_url":"https://github.com/szymonp-kainos","followers_url":"https://api.github.com/users/szymonp-kainos/followers","following_url":"https://api.github.com/users/szymonp-kainos/following{/other_user}","gists_url":"https://api.github.com/users/szymonp-kainos/gists{/gist_id}","starred_url":"https://api.github.com/users/szymonp-kainos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szymonp-kainos/subscriptions","organizations_url":"https://api.github.com/users/szymonp-kainos/orgs","repos_url":"https://api.github.com/users/szymonp-kainos/repos","events_url":"https://api.github.com/users/szymonp-kainos/events{/privacy}","received_events_url":"https://api.github.com/users/szymonp-kainos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-07T12:49:19Z","updated_at":"2015-04-07T14:25:11Z","closed_at":null,"body":"When search is called with wrong query (unrecognised key) fhirbase returns everything from requested resource type instead of empty result.\r\n\r\n```sql\r\nSELECT fhir.search_sql('Patient','id=42fa4d08-06a9-4da1-95ec-f829674bf6a2');\r\n```\r\nreturns\r\n```sql\r\nSELECT patient.version_id, patient.logical_id, patient.resource_type, patient.updated, patient.published, patient.category, patient.content FROM patient\r\nWHERE  true = true \r\nLIMIT 100\r\nOFFSET 0\r\n```\r\n\r\n```sql\r\nSELECT fhir.search_sql('Patient','_idd=42fa4d08-06a9-4da1-95ec-f829674bf6a2');\r\n```\r\nreturns\r\n```sql\r\nSELECT patient.version_id, patient.logical_id, patient.resource_type, patient.updated, patient.published, patient.category, patient.content FROM patient\r\nWHERE  true = true \r\nLIMIT 100\r\nOFFSET 0\r\n```\r\n\r\nSame for keys not even close to existing ones\r\n```sql\r\nSELECT fhir.search_sql('Patient','something=42fa4d08-06a9-4da1-95ec-f829674bf6a2');\r\n```\r\nreturns\r\n```sql\r\nSELECT patient.version_id, patient.logical_id, patient.resource_type, patient.updated, patient.published, patient.category, patient.content FROM patient\r\nWHERE  true = true \r\nLIMIT 100\r\nOFFSET 0\r\n```"},"comment":{"url":"https://api.github.com/repos/fhirbase/fhirbase/issues/comments/90584410","html_url":"https://github.com/fhirbase/fhirbase/issues/90#issuecomment-90584410","issue_url":"https://api.github.com/repos/fhirbase/fhirbase/issues/90","id":90584410,"user":{"login":"niquola","id":32066,"avatar_url":"https://avatars.githubusercontent.com/u/32066?v=3","gravatar_id":"","url":"https://api.github.com/users/niquola","html_url":"https://github.com/niquola","followers_url":"https://api.github.com/users/niquola/followers","following_url":"https://api.github.com/users/niquola/following{/other_user}","gists_url":"https://api.github.com/users/niquola/gists{/gist_id}","starred_url":"https://api.github.com/users/niquola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niquola/subscriptions","organizations_url":"https://api.github.com/users/niquola/orgs","repos_url":"https://api.github.com/users/niquola/repos","events_url":"https://api.github.com/users/niquola/events{/privacy}","received_events_url":"https://api.github.com/users/niquola/received_events","type":"User","site_admin":false},"created_at":"2015-04-07T14:25:11Z","updated_at":"2015-04-07T14:25:11Z","body":"Could you reopen this discussion in a fhir skype chat ;) I'll join\nOn Apr 7, 2015 4:45 PM, \"szymonp-kainos\" <notifications@github.com> wrote:\n\n> I can understand ignoring unknown but wouldn't it be better to return\n> empty result when no params are specified or all are ignore ?\n> I think strict version of search would be awesome.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/fhirbase/fhirbase/issues/90#issuecomment-90558222>.\n>\n"}}