> ## Documentation Index
> Fetch the complete documentation index at: https://docs.samsearch.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Keyword Search Syntax

> Boolean operators, field search, and Lucene syntax for precise Keyword Search queries

Use **Keyword Search** when you need exact control over terms, fields, and exclusions. This reference covers the operators supported in SamSearch.

<Info>
  New to boolean syntax? Use the **AI Query Generator** on the [Search](/features/search) page to convert plain English into a valid query.
</Info>

## Combining search terms

* `cybersecurity AND AI` — both terms must be present
* `construction OR building` — either term can be present
* `software NOT hardware` — exclude hardware results
* `(AI OR "artificial intelligence") AND security` — grouped conditions

<Warning>
  `NOT` must follow a positive clause. For example, use `("cybersecurity" AND "AI") AND NOT "project management"` — not `NOT` alone inside an `OR` group.
</Warning>

## Finding similar words

* `cyber*` — matches cybersecurity, cybernetics, etc.
* `construct~` — fuzzy match for construct, construction, etc.
* `governm~1` — fuzzy match with edit distance of 1
* `*security*` — matches any word containing "security"

## Searching specific fields

* `title:"construction services"` — search only in titles
* `summary:cybersecurity` — search only in summaries
* `agency:"Department of Defense"` — search specific agency
* `title:construction AND summary:government` — multiple fields

## Numbers and dates

* `value:[100000 TO 500000]` — contract value range
* `date:[2024-01-01 TO 2024-12-31]` — date range
* `value:>1000000` — greater than a specific value
* `due_date:[NOW TO +30DAYS]` — due within 30 days

## Exact phrases and proximity

* `"artificial intelligence"` — exact phrase match
* `"cybersecurity"~5` — terms within 5 words of each other
* `"government contract"~2` — phrase with word variations
* `"AI solutions" AND "cybersecurity"~10` — combined proximity

## Escaping special characters

The following characters must be escaped with backslashes when used in searches: `{`, `}`, `[`, `]`, `:`, `<`, `>`, `+`, `-`

**Examples:**

* Use `C\+\+` instead of `C++`
* Use `\[2024\]` instead of `[2024]`
* Use `\{contract\}` instead of `{contract}`

## Worked examples

| Goal                                   | Query                                                             |
| -------------------------------------- | ----------------------------------------------------------------- |
| AI and cybersecurity, exclude PM roles | `("cybersecurity" AND "AI") AND NOT "project management"`         |
| Construction for government or federal | `"construction" AND ("government" OR "federal")`                  |
| Healthcare software, no hardware       | `"software" AND "healthcare" AND NOT "hardware"`                  |
| Cloud security from DoD                | `agency:"Department of Defense" AND ("cloud" OR "cybersecurity")` |
| High-value contracts due soon          | `value:>1000000 AND due_date:[NOW TO +30DAYS]`                    |
| Title-only exact phrase                | `title:"IT support services"`                                     |

<Card title="Back to Search" icon="magnifying-glass" href="/features/search">
  Return to the main Search guide for sources, filters, and saving searches.
</Card>
