{"action":"created","issue":{"url":"https://api.github.com/repos/OpenConceptLab/oclapi/issues/79","labels_url":"https://api.github.com/repos/OpenConceptLab/oclapi/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/OpenConceptLab/oclapi/issues/79/comments","events_url":"https://api.github.com/repos/OpenConceptLab/oclapi/issues/79/events","html_url":"https://github.com/OpenConceptLab/oclapi/issues/79","id":54455764,"number":79,"title":"Lucene query syntax (e.g. boolean logic) should be supported for all search queries and filters","user":{"login":"paynejd","id":1189689,"avatar_url":"https://avatars.githubusercontent.com/u/1189689?v=3","gravatar_id":"","url":"https://api.github.com/users/paynejd","html_url":"https://github.com/paynejd","followers_url":"https://api.github.com/users/paynejd/followers","following_url":"https://api.github.com/users/paynejd/following{/other_user}","gists_url":"https://api.github.com/users/paynejd/gists{/gist_id}","starred_url":"https://api.github.com/users/paynejd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paynejd/subscriptions","organizations_url":"https://api.github.com/users/paynejd/orgs","repos_url":"https://api.github.com/users/paynejd/repos","events_url":"https://api.github.com/users/paynejd/events{/privacy}","received_events_url":"https://api.github.com/users/paynejd/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OpenConceptLab/oclapi/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/OpenConceptLab/oclapi/labels/medium-priority","name":"medium-priority","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"MisterNando","id":1670990,"avatar_url":"https://avatars.githubusercontent.com/u/1670990?v=3","gravatar_id":"","url":"https://api.github.com/users/MisterNando","html_url":"https://github.com/MisterNando","followers_url":"https://api.github.com/users/MisterNando/followers","following_url":"https://api.github.com/users/MisterNando/following{/other_user}","gists_url":"https://api.github.com/users/MisterNando/gists{/gist_id}","starred_url":"https://api.github.com/users/MisterNando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MisterNando/subscriptions","organizations_url":"https://api.github.com/users/MisterNando/orgs","repos_url":"https://api.github.com/users/MisterNando/repos","events_url":"https://api.github.com/users/MisterNando/events{/privacy}","received_events_url":"https://api.github.com/users/MisterNando/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/OpenConceptLab/oclapi/milestones/4","html_url":"https://github.com/OpenConceptLab/oclapi/milestones/OpenMRS%20Module%20Reqs","labels_url":"https://api.github.com/repos/OpenConceptLab/oclapi/milestones/4/labels","id":932765,"number":4,"title":"OpenMRS Module Reqs","description":"Finalize features/bugs required for OpenMRS-OCL module to subscribe to dictionaries","creator":{"login":"paynejd","id":1189689,"avatar_url":"https://avatars.githubusercontent.com/u/1189689?v=3","gravatar_id":"","url":"https://api.github.com/users/paynejd","html_url":"https://github.com/paynejd","followers_url":"https://api.github.com/users/paynejd/followers","following_url":"https://api.github.com/users/paynejd/following{/other_user}","gists_url":"https://api.github.com/users/paynejd/gists{/gist_id}","starred_url":"https://api.github.com/users/paynejd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paynejd/subscriptions","organizations_url":"https://api.github.com/users/paynejd/orgs","repos_url":"https://api.github.com/users/paynejd/repos","events_url":"https://api.github.com/users/paynejd/events{/privacy}","received_events_url":"https://api.github.com/users/paynejd/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":7,"state":"open","created_at":"2015-01-13T02:36:55Z","updated_at":"2015-02-28T00:32:22Z","due_on":"2015-01-24T05:00:00Z","closed_at":null},"comments":2,"created_at":"2015-01-15T14:37:33Z","updated_at":"2015-03-08T17:41:33Z","closed_at":null,"body":"Currently, it is not possible to use any of the standard Lucene query language when searching resources or applying filters. This means that currently only one search term or filter can be sent at a time. For example, it is not possible to filter concepts using Datatype = \"Anatomy OR Diagnosis\". As much as possible, the Lucene query language should be supported at the API level for search criteria and for filters. The full Lucene query syntax is here: http://lucene.apache.org/core/2_9_4/queryparsersyntax.html\r\n\r\nThe API should support passing these values as text parameters **in the same syntax as Lucene syntax**. The table below lists which modifiers are currently supported and which are required. Ideally, all will be supported, but the priority is on those listed as \"required\" features.\r\n\r\n| Lucene Search Operator | Example | Currently Supported by API | Required Feature by API |\r\n| -------------- | ----- | ------- | ------- |\r\n| Terms | `malaria pregnancy` | YES | YES |\r\n| Boolean Operators | `\"jakarta apache\" jakarta`, `\"jakarta apache\" OR jakarta`, `\"jakarta apache\" AND \"Apache Lucene\"`, `+jakarta lucene`, `\"jakarta apache\" NOT \"Apache Lucene\"`, `\"jakarta apache\" -\"Apache Lucene\"` | NO | YES |\r\n| Fields | `title:\"The Right Way\"`, `text:go` | NO | YES |\r\n| Wildcard Search | `chil?`, `chil*`, `te*t` | NO | YES |\r\n| Escaping Special Characters | `\\(1\\+1\\)\\:2` | NO | YES |\r\n| Fuzzy Search | `roam~`, `roam~0.8` | NO | NO |\r\n| Proximity Search | `\"jakarta apache\"~10` | NO | NO |\r\n| Range Search | `mod_date:[20020101 TO 20030101]`, `title:{Aida TO Carmen}` | NO | NO |\r\n| Term Boosting | `jakarta^4 apache` | NO | NO |\r\n| Grouping | `(jakarta OR apache) AND website` | NO | NO |\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/OpenConceptLab/oclapi/issues/comments/77763589","html_url":"https://github.com/OpenConceptLab/oclapi/issues/79#issuecomment-77763589","issue_url":"https://api.github.com/repos/OpenConceptLab/oclapi/issues/79","id":77763589,"user":{"login":"MisterNando","id":1670990,"avatar_url":"https://avatars.githubusercontent.com/u/1670990?v=3","gravatar_id":"","url":"https://api.github.com/users/MisterNando","html_url":"https://github.com/MisterNando","followers_url":"https://api.github.com/users/MisterNando/followers","following_url":"https://api.github.com/users/MisterNando/following{/other_user}","gists_url":"https://api.github.com/users/MisterNando/gists{/gist_id}","starred_url":"https://api.github.com/users/MisterNando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MisterNando/subscriptions","organizations_url":"https://api.github.com/users/MisterNando/orgs","repos_url":"https://api.github.com/users/MisterNando/repos","events_url":"https://api.github.com/users/MisterNando/events{/privacy}","received_events_url":"https://api.github.com/users/MisterNando/received_events","type":"User","site_admin":false},"created_at":"2015-03-08T17:41:33Z","updated_at":"2015-03-08T17:41:33Z","body":"@paynejd , I implemented this and pushed it to dev.  However, there are 2 caveats:\r\n\r\n1. I would assert that the API client shouldn't know anything about the naming of Solr fields, and therefore field search should not be allowed.  (We have a separate mechanism for specifying filters and facets.)\r\n\r\n2. We can support escaping of special characters, but I'm not sure if this buys us anything.  When the index is created, non-alphanumeric characters are treated as token-boundaries and are ignored.\r\n\r\nThe other operators you specified as NOT required are actually pretty cheap to support, so I've included them as well (with the exception of range search, for the same reason as caveat #1 above).\r\n\r\nIf this is acceptable, please close the ticket."}}