## Document-Level And Text Unit-Level Analysis Once you have uploaded documents to a project, you can use several different features of the Document Explorer to dig deeper into the data within your documents. To view Document-Level analysis in the Document Explorer go to **Documents** > **Document List**. To view Text Unit-Level analysis in the Document Explorer go to **Text Units** > **Text Unit List**. --- #### Advanced Search with DjangoQL There are many ways to use ContraxSuite to find items of interest that are already contained in your documents. For a targeted search within the Document Explorer, sometimes you might only need to engage Filters on either the Document List or the Text Unit List Grids. For a more targeted search, the ContraxSuite Document Explorer supports [DjangoQL searches](https://www.lexpredict.com/2020/10/query-language-advanced-search-contraxsuite-1-7-0/). DjangoQL is useable both on the Document List and the Text Unit List: * **Documents** > **Document List**: On the Grid, click the checkbox next to the search bar in the upper left * **Text Units** > **Text Unit List**: On the Grid, click the checkbox next to the search bar in the upper left Below are basic instructions for running an advanced, DjangoQL-based search inside the Document Explorer. **1.** From the Document List or Text Unit List Grid, select a specific project in the Project Selection drop-down in the top right. ![DQLProjSelect](../../_static/img/guides/DocExp/Admin/DQLProjSelect.png) **2.** Select the checkbox to the left of the search bar to engage DjangoQL ("Advanced") search. ![DQLEngage](../../_static/img/guides/DocExp/Admin/DQLEngage.png) **3.** Start typing. A drop-down with auto-complete options will prompt you with options for values to query. (**Note:** Not all ContraxSuite tables are automatically populated when documents are loaded. Copyrights, Courts, and other Data Entities are not automatically extracted when documents are uploaded. See the [Running Locators](../doc_exp/locators.md) page for more.) You can also "Export" the whole grid of documents or text units to `.xslx`, `.csv`, or `.pdf` via the button in the upper right. ![DQLExport](../../_static/img/guides/DocExp/Admin/DQLExport.png) Here are a few tips for writing queries in Advanced Search DjangoQL: * DjangoQL searches are case-sensitive. ContraxSuite standardizes many objects to certain capitalizations, so Definitions, Companies, and Parties must be written in UPPERCASE. * Dates must be written in "YYYY-MM-DD" format (*e.g.,* "January 15th, 2020" must be written as "2020-01-15") * Model Fields: These are defined in Python code within ContraxSuite. Access nested properties by typing `.`, For example: * `currencyusage.amount` - Currency amounts * `termusage.term.term` - Terms found in ContraxSuite's "Terms Dictionary" * `definitionusage.definition` - Terms defined in a document as definitions ("Definitions") * `partyusage.party.name` - Party names
* Strings must use regular 'double' quotation marks. Single, or 'scare' quotes, are not supported. To escape a double quote, use "\\\" * Boolean and null values: Type `True`, `False`, or `None`. These three terms can all *only* be combined with equality operators, *e.g.,* `published = False` or `date_published = None` * Logical operators: `and`, `or` (**Note:** these operators will only work when typed lowercase) * Comparison operators: * `=` - is equal to * `!=` - is not equal to * `~` - contains a substring * `!~` - does not contain a substring * `<` - less than * `<=` - less than or equal to * `>` - greater than * `>=` - greater than or equal to * `in` - value is in the referenced list * `not in` - value is not in the referenced list For more information on using DjangoQL to run Advanced Searches in the Document Explorer, click the "Syntax Help" link that appears in the drop-down autocomplete list in the Advanced Search bar. ![DQLSyntaxHelp](../../_static/img/guides/DocExp/Admin/DQLSyntaxHelp.png) For additional help and tips on using DjangoQL, visit the [DjangoQL page from python.org](https://pypi.org/project/djangoql/0.6.4/) ###### Examples of Query Language **Example 1**: The following query will find all text units/documents that contain defined terms of either "Employee" or "Executive", and that also contain at least one party that has the word "energy" in its name: `definitionusage.definition in ("EMPLOYEE", "EXECUTIVE") and partyusage.party.name ~ "ENERGY"` **Example 2**: The following query will find all text units/documents that contain at least one currency value over 1000, and that also contain at least one date value: `currencyusage.amount >=1000 and dateusage.date != None` **Example 3**: The following query will find all text units/documents that contain some kind of currency, and that also contain either a date or a date duration value: `currencyusage != None and (dateusage != None or datedurationusage != None)` **Example 4**: The following query will find all text units/documents that contain a currency amount above 45000, or the query will find all text units/documents that contain currency values denominated in Euros: `currencyusage.amount > 45000 or currencyusage.currency = "EUR"` **Example 5**: The following query will find all text units/documents that contain the term "term", and that also contain a numeric duration value: `termusage.term.term in ("term") and datedurationusage.amount != None`