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

# Lucene

Epiq AI supports Lucene syntax for keyword search. Below is a list of query examples:

<table><thead><tr><th width="181.33333333333331">Query</th><th width="263">Search string</th><th>Description</th></tr></thead><tbody><tr><td><strong>Single word</strong></td><td>foo</td><td /></tr><tr><td><strong>Phrase</strong></td><td>"foo bar"</td><td /></tr><tr><td><strong>AND, OR, NOT</strong></td><td>foo AND bar, foo OR bar, foo NOT bar</td><td>The "NOT" operator excludes documents that contain the term after NOT. It cannot be used with just one term, for example, NOT foo will not work.</td></tr><tr><td><strong>Wildcard search</strong></td><td>foo\*, foo\*bar, foo?, foo?bar</td><td>"?" is used for single character wildcard search; "\*" is used for multiple character wildcard search. "\*" and "?" cannot be used as the first character of a search.</td></tr><tr><td><strong>Fuzzy search</strong></td><td>foo\~, foo\~0.8</td><td>Use "\~" at the end of a single word term to search for a similar term based on string similarity. You can specify the similarity value between 0 and 1 with a higher value indicating higher similarity.</td></tr><tr><td><strong>Proximity search</strong></td><td>"foo bar"\~10</td><td>Use "\~" at the end of a phrase like "foo bar"\~10 to search for a "foo" and "bar" within 10 words of each other in a document. Note that the proximity search in Lucene is ordered, i.e., the terms will be matched in exact order.</td></tr><tr><td><strong>Regular expression</strong></td><td>/\d+/</td><td>Wrap regex inside <code>/</code> and <code>/</code></td></tr></tbody></table>

## **Regular expression**

A common list of regular expressions

| Query                  | Regular Expression                           | Match results                               |
| ---------------------- | -------------------------------------------- | ------------------------------------------- |
| Social security number | /\d\{3}-\d\{2}-\d\{4}/                       | 010-00-1234                                 |
| Dates                  | /\[0-9]\{2}/\[0-9]\{2}/\[0-9]\{2,4}/         | 09/27/2000                                  |
| Phone numbers          | /(\[0-9]\{3}-)?\[0-9]\{3}-\[0-9]\{4}/        | 301-280-6231                                |
| Email addresses        | /(\[\w\_.]+)\\@(\[\w\_.]+).(\[\w\_.]\{2,6})/ | [abc.123@test.com](mailto:abc.123@test.com) |
