Catalog / Solr Query Language Cheatsheet
Solr Query Language Cheatsheet
A quick reference guide to the Solr Query Language (SQL), covering syntax, operators, functions, and best practices for effective searching and data retrieval within Solr.
Basic Syntax & Query Parameters
Core Query Syntax
|
|
|
|
|
|
Query Operators
|
Boolean operators for combining query terms. |
|
Specifies that a term must be present in the document. |
|
Excludes documents containing the term. |
|
Specifies a field for the term. |
|
Wildcard for matching any characters. |
|
Wildcard for matching a single character. |
Advanced Querying
Fuzzy Search
Fuzzy searches find terms that are similar to a specified term. |
Note: The distance value is optional. If not specified, the default value is 2. |
Proximity Search
Proximity searches find terms that are within a specific distance from each other. |
Range Queries
Range queries match documents whose field(s) values are between the upper and lower bounds specified. |
To exclude the upper or lower bound, use curly brackets |
Boosting
|
Assigns a higher relevance score to terms, increasing their ranking in the results. |
Note: |
The default boost factor is 1. Values greater than 1 increase the score, while values less than 1 decrease the score. |
Function Queries & Local Parameters
Function Queries
Function queries allow you to use functions to calculate a score based on field values. |
Common Functions: |
Local Parameters
Local parameters allow you to modify the behavior of specific query parts. |
Common Parameters: |
Spatial Queries
Solr supports spatial queries to find documents within a certain distance of a point. |
Solr SQL Interface
Basic SQL Syntax
Solr provides an SQL interface for querying data using standard SQL syntax. |
SQL Functions
|
Counts the total number of documents in the collection. |
|
Calculates the average value of a numeric field. |
|
Calculates the sum of a numeric field. |
|
Finds the minimum value of a numeric field. |
|
Finds the maximum value of a numeric field. |
Joins
Solr supports JOIN operations to combine data from multiple collections. |