Welcome to the Solr Query Syntax Documentation. This guide will provide you with a comprehensive overview of the query syntax used in Solr, a popular, open-source enterprise search platform.

Basic Query Syntax

The basic syntax for a Solr query is straightforward:

<query> = <query_string>

Where <query_string> is a string that represents the search criteria.

Common Query Types

  • Term Query: Searches for an exact term.
    • Example: name:John
  • Prefix Query: Searches for terms that start with a specific prefix.
    • Example: name:Jo*
  • Wildcard Query: Searches for terms that match a pattern.
    • Example: name:John*

Advanced Query Syntax

Solr supports advanced query syntax that allows for more complex search criteria.

Boolean Queries

Boolean queries combine multiple search criteria using logical operators (AND, OR, NOT).

  • Example: (name:John OR name:Bob) AND age:30

Range Queries

Range queries search for terms within a specified range.

  • Example: age:[25 TO 35]

Boosting Queries

Boosting queries increase the relevance of certain terms in the search results.

  • Example: name:John^10

Useful Links

For further reading, please check out the following resources:

Solr Query Syntax Example