Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel2
outlinefalse
typelist
printablefalse

Search operations are an extremely powerful feature for locating content; they work on the metadata of the objects within the storage cluster. Searches use metadata matching constraints provided in the client request and return a list of objects that match those constraints.

Searches can take place across all objects within the domain or searches can be constrained to the context of a particular bucket. When full metadata search is enabled, you can use any custom metadata field value as a search constraint.

Infotip

Best

practice

Practice

Do not apply a context filter redundantly in cases where Swarm filters by default, such as when searching for named objects in a bucket, buckets in a domain, or unnamed objects in a domain.

Performance Impact

Consider performance when designing searches spanning entire domains. context (domain and bucket) names are looked up from the contextid, so these domain-wide searches incur an additional performance penalty:

...

Info

Tip

Check the performance impact when sorting and filtering across an entire domain.

Search Examples

Unless otherwise noted all matching operations are string-based comparisons:

...

Code Block
languagexml
GET /myBucket?format=json&domain=myDomain
	&fields=name,content-length

Enabling

...

Case-

...

Insensitive Search (name.lower)

You control case-sensitivity in your Elasticsearch queries by using the correct form of the name field:

...

The Swarm search setting, search.caseInsensitive, is specific to SCSP queries, versus querying ES directly. When this is enabled, case-insensitive SCSP search queries are performed by default. (v9.0)

Swarm Setting

Effect

search.caseInsensitive = 1

All name-based searches use the name.lower field, so SCSP named searches are always case-insensitive.

search.caseInsensitive = 0

All name-based searches use the name field, and is case-sensitive.

Info

Important

Custom metadata values are always indexed to be only case-sensitive or case-insensitive, depending on the value of search.caseInsensitive. If an index is built with the wrong setting, you must change the setting and build a new index.

Using

...

Content-

...

Length

The content-length field for objects is recognized as a numeric field and supports equality, less-than-equal-to, and greater-than-equal-to matching operators.

Info

Tip

Use ">=" or "=>" and "<=" or "=<".

Using content-length
Code Block
languagexml
GET /?format=json&domain=myDomain&content-length=1024 
GET /?format=json&domain=myDomain&content-length<=1024 
GET /?format=json&domain=myDomain&content-length>=1024

...