Advanced search filters in docXporter

Usually if searching for documents to be exported with docXporter it is sufficient to define simple search criteria with fixed values. Detailed information about this use case can be found in the article Configure docXporter.

This articles discusses more sophisticated options to search for documents. If you are not familiar with docXporter or haven’t completed the basic setup yet, we recommend to read the article about the configuration first.

Basic search operations

Syntax to work with operators such as greater than or less than: Value="~~[OPT]~~SEARCHFORVALUE”

Example of a search in the COMPANY field for all documents beginning with Peters:

<Object Name="DWArchivFilter" Type="Docuscan.DocuwareExporter.Configuration.FieldMapping">
  <Item Name="COMPANY" Value="Peters*" />
</Object>

Example for special characters, which require escaping:

<Object Name="DWArchivFilter" Type="Docuscan.DocuwareExporter.Configuration.FieldMapping">
  <Item Name="DOCUMENTTYPE" Value="Invoice\(incoming\)"/>
</Object>

In the above example the brackets ( ) are escaped with backslash \ this applies to other special characters.

Example of a search that searches in the COUNTER field for documents that are greater than 1,000 and less than 2,000:

<Object Name="DWArchivFilter" Type="Docuscan.DocuwareExporter.Configuration.FieldMapping">
  <Item Name="COUNTER" Value="~~[gt]1000~~[lt]2000" />
</Object>

Example of a search that searches the internal DWSTOREDATETIME field for documents that have been archived in the last 3 days (including the current day):

<Object Name="DWArchivFilter" Type="Docuscan.DocuwareExporter.Configuration.FieldMapping">
  <Item Name="DWSTOREDATETIME" Value="~~[gte]~~DATE(-3D)~~[lte]~~DATE()" />
</Object>

More options and their description:

  • [ne] unequal (corresponds to <> in DocuWare)

  • [lt] smaller than (corresponds to < in DocuWare)

  • [gt] greater than (corresponds to > in DocuWare)

  • [lte] less than or equal to (corresponds to <= in DocuWare)

  • [gte] greater than or equal to (corresponds to >= in DocuWare)

Fixed values may also be used instead of a variable.

<Object Name="DWArchivFilter" Type="Docuscan.DocuwareExporter.Configuration.FieldMapping">
  <Item Name="DWSTOREDATETIME" Value="~~[gte]~~01.01.2021~~[lte]~~31.12.2021" />
</Object>

Predefined search periods

Use these functions to generate a search string directly.

For example, the SEARCH_YEAR() function is replaced by ~~[gte]01.01.2021~~[lte]~~31.12.2021 ersetzt.

These functions may only be used exclusively, because they generate a complete search filter.

SEARCH_YEAR()

Returns a search period from 01.01-31.12. of the current year.

SEARCH_MONTH()

Returns a search period from the first to the last day of the current month.

SEARCH_QUARTER()

Returns a search period from the first day to the last day of the current quarter.

By specifying a parameter such as -1 or +1, the return value is adjusted accordingly. Any value can be specified. The -/+ operator must always be specified.

The functions process the parameter depending on the context. For example, YEAR(-1) returns the year of the previous year, while MONTH(-1) returns the month number of the previous month.

Flexible search periods

The search string is not compiled automatically here - but allows you to define more define more flexible time periods. The DATE() function is available for this purpose.

By specifying a parameter such as -1D or +1D, the return value is adjusted accordingly. Any value can be specified. The -/+ character must always be specified, it is also necessary to specify which part of the date is to be modified.

Use the letter D for days, M for months and Y for years. This is required to tell the DATE()-function which part of the date should be modified.

Examples

DATE()

24.06.2024

DATE(+10D)

04.07.2024

DATE(-1M)

23.05.2024

“Search within the last 2 weeks”

~~[gte]DATE(-14D)~~[lte]~~DATE(-1D) this results in ~~[gte]10.06.2021~~[lte]~~23.06.2021

Parameters

In the above examples, no value was used within the brackets of the functions were used. This means that the current date is always used as the starting point for the result.

By specifying a parameter such as -1 or +1, the return value is adjusted accordingly. Any value can be specified. The -/+ character must always be specified.

The functions process the parameter depending on the context. For example, YEAR(-1) returns the year of the previous year, while MONTH(-1) returns the month number of the previous month.

With the group 1 functions, the function parameter also has a context-dependent effect. So it returns periods from the previous year or previous months.