Skip to content

Filter query

The fq parameter defines a filter that restricts the superset of documents that can be returned.

fq=[field]:[filter criteria]

You can add multiple fq parameter in one request. Only documents matching all filter criteria can be returned (logical AND). The fq parameter does not influence the score.

Filter queries can be combined with visual search.

Keyword filter

Match documents where a specific keyword (term) exists for a field. Wildcards are also supported.

# Search in field id for term 6
fq=id:6
# Search in field keywords for term product
fq=keywords:product
# Match docs with field keywords for all terms beginning with produ
fq=keywords:produ*

Existence filter

Find all documents where a value exists for a field by simply specifying a wildcard * as term.

# Find all docs where a value exists for field
fq=field:*

Range filter

Solr native parameter · full docs

Match documents with a range of values for a field.

# price between 10 and 100, inclusive
fq=price:[10 TO 100]
# price between 10 and 100, exclusive
fq=price:[10 TO 100}
# price between 10 and 100, exclusive both
fq=price:{10 TO 100}
# price higher than or equal to 10
fq=price:[10 TO *]
# price less than or equal to 100
fq=price:[* TO 100]

Range queries are not limited to numerical values. They can also be applied on date fields and string fields (using alphabetical range).

Copy space filter

Images with detected copy space

The copy space filter can be easily applied as fq parameter using the copyspace field.

Each indexed image is divided into a 3x3 grid. Each cell is numbered in scanline order (beginning with 0 in the upper left corner and ends with 8 in lower right corner). You can filter for one or more individual cells to find images suitable for adding text in these areas.

0 1 2
3 4 5
6 7 8

Search for images that are suitable for adding content.

fq=copyspace:*

Find images suitable to add content in the center.

fq=copyspace:4

Search for images that are suitable for adding content to the top of the image. To apply two or more boolean operators to a single field in a search, group the boolean clauses within parentheses.

fq=copyspace:(+0 +1 +2)

Search for images that are suitable for adding content to the right side the image.

fq=copyspace:(+2 +5 +8)

Search for images that are suitable for adding content anywhere in the image.

fq=copyspace:(+0 +1 +2 +3 +4 +5 +6 +7 +8)

Search for images that are suitable for adding content to the upper left corner of the image, but not in the center.

fq=copyspace:(+0 -4)

Color names filter

The following names can be used as filter values: black, white, red, orange, yellow, green, turquoise, blue, violet, pink, brown and grey.

Shades & tints of a color are mapped to the same name. The idea is to have a limited number of color buckets suitable for coarse filtering and faceting.

Search for images having red as dominant color.

fq=color_names:red

Search for images without blue as dominant color.

fq=-color_names:blue

Search for images having yellow as dominant color and no grey color.

fq=color_names:(+yellow -grey)

Isolated content filter

Images with a detected background are marked as isolated. You can search for images with isolated content (like product shots or design material) by using the boolean field color_isolated.

fq=color_isolated:true

Solr native parameter · full docs

Faceted search segment the results of a search query into parametrized categories, allowing users to refine their searches more intentionally using the facets as filters to narrow down their search results.

To activate or deactivate facets use this main parameter:

facet=[true | false]

facet and facet.field must be specified to actually return facets.

Fieldvalue faceting

The face.field parameter identifies a field that should be used to generate the facets. It iterates over each term in the field and counts the number of documents containing that term.

facet.field=[fieldname]

Use multiple facet.field parameter for multiple facet fields.

Min facet count

The facet.mincount parameter defines the minimum count required to be part of the response. Default is facet.mincount=0.

facet.mincount=[0-]

Exlude facets

The facet.excludeTerms parameter excludes the terms from being returned as facets in the response. Use this parameter if you know which terms should be ignored.

facet.excludeTerms=[terms]

Include facets

The facet.matches parameter defines which terms are included as facets. Use this parameter if you know which terms should be allowed.

facet.matches=[regex]