> ## 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.&#x20;

### Query examples

| Query                  | Search string                        | Description                                                                                                                                                                                                                          |
| ---------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Single word**        | foo                                  | ​                                                                                                                                                                                                                                    |
| **Phrase**             | "foo bar"                            | ​                                                                                                                                                                                                                                    |
| **AND, OR, NOT**       | foo AND bar, foo OR bar, foo NOT bar | 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.                                                                                     |
| **Wildcard search**    | foo\*, foo\*bar, foo?, foo?bar       | "?" 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.                                                               |
| **Fuzzy search**       | foo\~, foo\~0.8                      | 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.                            |
| **Proximity search**   | "foo bar"\~10                        | 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. |
| **Regular expression** | /\d+/                                | Wrap regex inside `/` and `/`                                                                                                                                                                                                        |

### **Regular expressions** <a href="#regular-expression" id="regular-expression" />

| 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) |
