Skip to content

Instantly share code, notes, and snippets.

@orendon
Last active October 11, 2016 22:03
Show Gist options
  • Save orendon/1fa89ebe61524e962a0d0901fde4a6e1 to your computer and use it in GitHub Desktop.
Save orendon/1fa89ebe61524e962a0d0901fde4a6e1 to your computer and use it in GitHub Desktop.
clojars query syntax docs proposal

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:

Terms

There are 2 types of terms:

  • A term is a single word such as oauth or sql
  • A phrase is just a bunch of words grouped by quotes, like "sql builder"

Boolean operators

Terms can be combined with operators in order to build less simple queries:

  • AND matches both terms, i.e. google AND oauth
  • NOT excludes the term after NOT, i.e. auth NOT SNAPSHOT
  • OR matches if either of the terms is present, i.e. ldap OR saml

Grouping

Parentheses can be used to form sub queries, i.e. (ldap OR saml) AND ADFS

Wildcards

  • ? 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

See also: Lucene own Query Syntax Tutorial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment