- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 113
 
Search Query Syntax
        Toby Crawley edited this page Jan 6, 2018 
        ·
        10 revisions
      
    Hi! Today I'll walk you through Lucene search engine syntax to make the best use of clojars website.
We can see a search query as a bunch of terms and operators, let's explore several ways to use our search engine:
There are 2 types of terms:
- A 
termis a single word such asoauthorsql - A 
phraseis just a bunch of words grouped by quotes, like"sql builder" 
Terms can be combined with operators in order to build more complex queries:
- 
ANDmatches both terms, i.e.google AND oauth - 
NOTexcludes the term after NOT, i.e.auth NOT SNAPSHOT - 
ORmatches if either of the terms is present, i.e.ldap OR saml 
Parentheses can be used to form sub queries, i.e. (ldap OR saml) AND ADFS
- 
?single character wildcard search for terms that matches with a single character replaced, i.e.oauth? - 
*multiple character wildcard searches for 0 or more characters, i.e.oauth* 
Do not use ? or * as the first character of a search
The following fields are searchable using the field-name:search-term syntax (without the field prefix, all fields are searched):
- 
group-id-[group-id:com.cemerick](https://clojars.org/search?q=group-id%3Acom.cemerick) - 
artifact-id-[artifact-id:clj*](https://clojars.org/search?q=artifact-id%3Aclj*) - 
version-[version:0.*](https://clojars.org/search?q=version%3A0.*) - 
description- the description pulled from the pom:[description:useful](https://clojars.org/search?q=description%3Auseful) - 
licenses- a concatenation of any licenses listed in the pom:[licenses:mit](https://clojars.org/search?q=licenses%3Amit) - 
url- the homepage listed in the pom:[url:gitlab.com](https://clojars.org/search?q=url%3Agitlab.com) - 
at- the time the release was created. Times are best queried as ranges, either using the default Lucene syntax of specifying epoch times:[at:[1515200516 TO 1515274516]](https://clojars.org/search?q=at%3A%5B1515200516+TO+1515274516%5D)or as ISO-8601 datetime strings (a Clojars extension to Lucene's search syntax):[at:[2017-12-24T00:00:00Z TO 2018-01-01T00:00:00Z]](https://clojars.org/search?q=at%3A%5B2017-12-24T00%3A00%3A00Z+TO+2018-01-01T00%3A00%3A00Z%5D) 
See also: Lucene's own Query Syntax Tutorial.
All clojars-web wiki content licensed under a Creative Commons Attribution-ShareAlike 4.0 International License
