SCMD now supports intelligent search with two different modes: AND logic and OR logic.
When you search with space-separated words, ALL words must be present in the result.
Example:
scmd> postgresql replication slave
This will find records where the command OR description contains:
- "postgresql" AND
- "replication" AND
- "slave"
Results:
ID: 786
Description: Postgresql Replication check on SLAVE Server inside a docker container
Command: $ docker exec POSTGRESQL-SLAVE psql -U ricardo -c "SELECT * FROM pg_stat_wal_receiver;"
ID: 787
Description: Postgresql Replication delay check on SLAVE Server inside a docker container
Command: $ docker exec POSTGRESQL-SLAVE psql -U ricardo -c "SELECT now() - pg_last_xact_replay_timestamp() AS replication_lag;"
Both results contain all three words: "postgresql", "replication", and "slave" (or "SLAVE").
When you search with comma-separated patterns, ANY pattern can match.
Example:
scmd> docker,kubernetes,postgresql
This will find records that contain:
- "docker" OR
- "kubernetes" OR
- "postgresql"
Results: All commands related to docker, kubernetes, or postgresql.
You can combine both! Use commas for OR and spaces within each pattern for AND.
Example:
scmd> postgresql replication,docker backup
This will find records that contain:
- ("postgresql" AND "replication") OR
- ("docker" AND "backup")
Search: postgresql replication
Finds: 4 results (all postgresql replication commands)
Search: postgresql replication slave
Finds: 2 results (only slave-related replication commands)
Search: postgresql replication slave delay
Finds: 1 result (the specific delay check command)
Search: docker,kubernetes
Finds: All docker commands + all kubernetes commands
Search: docker logs,kubernetes logs
Finds: Docker log commands + Kubernetes log commands
Search: git branch
Finds: Commands containing both "git" and "branch"
Search: git branch delete
Finds: Commands about deleting git branches
Search: git branch,git merge,git rebase
Finds: Commands about branches OR merges OR rebases
scmd> postgresql
[Too many results]
scmd> postgresql replication
[Better - 4 results]
scmd> postgresql replication slave
[Perfect - 2 results]
scmd> postgresql replication slave delay
[Exact - 1 result]
scmd> docker,kubernetes,terraform
[All commands for these three tools]
scmd> docker compose,kubernetes deployment
[Docker compose commands OR Kubernetes deployment commands]
scmd> POSTGRESQL REPLICATION
scmd> postgresql replication
scmd> PostgreSQL Replication
All three searches return the same results!
scmd> postgresql replication slave
scmd> slave replication postgresql
scmd> replication slave postgresql
All three searches return the same results!
Both the command and description fields are searched:
Example Record:
ID: 786
Description: Postgresql Replication check on SLAVE Server inside a docker container
Command: $ docker exec POSTGRESQL-SLAVE psql -U ricardo -c "SELECT * FROM pg_stat_wal_receiver;"
Search: postgresql replication slave
Matches because:
- "Postgresql" is in the description ✓
- "Replication" is in the description ✓
- "SLAVE" is in both description and command ✓
SCMD uses partial matching (ILIKE with %), so:
Search: replic
Finds: Commands with "replication", "replica", "replicate", etc.
Search: post
Finds: Commands with "postgresql", "postgres", "post", etc.
Special characters are treated as literal characters:
Search: pg_stat_replication
Finds: Commands containing "pg_stat_replication"
scmd> docker restart
scmd> kubernetes scale
scmd> postgresql backup
scmd> nginx reload
scmd> docker,kubernetes
scmd> postgresql,mysql,mongodb
scmd> git,svn
scmd> postgresql replication master
scmd> docker compose logs
scmd> kubernetes deployment rollout
scmd> error logs
scmd> check status
scmd> debug connection
scmd> postgresql replication slave
[Results displayed with formatting]
scmd> /search postgresql replication slave
[Same results]
# Space-separated (AND logic)
scmd.exe --search "postgresql replication slave"
# Comma-separated (OR logic)
scmd.exe --search "docker,kubernetes"Both modes use the same search logic!
Problem: postgresql replication slave delay master
Result: No results
Why? Too specific - no single record contains ALL five words.
Solution: Remove some words:
scmd> postgresql replication slave delay
[Found 1 result]
Problem: docker
Result: 500+ results
Why? Too broad - many commands use docker.
Solution: Add more specific words:
scmd> docker logs
[Found 15 results]
scmd> docker logs follow
[Found 3 results]
Problem: Searching for "master" but getting "mastercard" results
Solution: Add more context words:
scmd> postgresql master
[More relevant results]
If you're getting unwanted results, add more specific terms:
scmd> log
[Too many results including "login", "logical", etc.]
scmd> docker log
[Better - only docker logging commands]
Use OR logic to find related commands:
scmd> backup,restore,dump
[All backup-related commands]
scmd> kubectl
scmd> docker exec
scmd> psql
scmd> check status
scmd> list all
scmd> show running
- Fast: PostgreSQL indexes make searches instant
- Efficient: Case-insensitive matching (ILIKE)
- Scalable: Works with millions of commands
- Smart: AND/OR logic for precise results
| Search Type | Syntax | Logic | Example |
|---|---|---|---|
| AND (all words) | Space-separated | All words must match | postgresql replication slave |
| OR (any pattern) | Comma-separated | Any pattern can match | docker,kubernetes |
| Combined | Mix both | Complex queries | docker logs,kubernetes logs |
Remember:
- Spaces = AND (narrow down)
- Commas = OR (broaden)
- Case doesn't matter
- Order doesn't matter
- Partial matching works
Happy searching! 🔍