# Query Syntaxes

Query processing time depends on the syntax that the query uses. Different syntaxes are available, and some require you to create fields in a specific way.

## Fastest

Syntax: | `action=Query&Text=text&FieldText=EQUAL{numericalAttribute}:fieldName`
Requirements: | create a numeric field for each attribute store these fields as numeric fields in the IDOL Content component
Example: | Four attributes are available to indicate which categories a document belongs to: England, France, Germany, USA It uses numbers to indicate which attributes apply to a document: 1—England, 2—France, 3—Germany, 4—USA In documents, you create a numeric field for each category that they belong to. For example, if a document belongs to the categories France and USA:
    #DREFIELD Cat1="2"
    #DREFIELD Cat2="4"
The following query returns documents that match the specified `Text` and contain the value 4 in one of their `Cat` fields (for example, `Cat1`). The value 4 indicates that the documents belong to the USA category.
    action=Query&Text=presidential election&FieldText=EQUAL{4}:Cat*
Syntax: | `action=Query&Text=text&FieldText=MATCH{attribute}:fieldName`
Requirements: | create a field for each attribute
Example: | Four attributes are available to indicate which categories a document belongs to: England, France, Germany, USA In documents, you create a field for each category that they belong to. For example, if a document belongs to the categories France and USA:
    #DREFIELD Cat1="France"
    #DREFIELD Cat2="USA"
The following query returns documents that match the specified `Text` and contain the value France in one of their `Cat` fields (for example, `Cat1`).
    action=Query&Text=presidential election&FieldText=MATCH{France}:Cat*
Syntax: | `action=Query&Text=text&FieldText=BITAND{numericalAttribute}:fieldName`
Requirements: | assign each attribute a bit create a numeric field for all attributes (if you have more than 32 bits, you need more fields) store this field as a numeric field in the IDOL Content component
Example: | Four attributes are available to indicate which categories a document belongs to: England, France, Germany, USA Assign a bit value to each attribute: 1—France, 2—England, 4—Germany, 8—USA In documents, you create a field for the categories that they belong to. For example, if a document belongs to the categories France and USA:
    #DREFIELD Cat="9"
The following query returns documents that match the specified `Text` and contain the value 10 in its `Cat` field. The value 10 indicates that documents must belong to the England or the USA category.
    action=Query&Text=presidential election&FieldText=BITAND{10}:Cat

## Slowest

Syntax: | `action=Query&Text=text&FieldText=STRING{attribute}:fieldName`
Requirements: | create a field that contains a comma-separated list of the document attributes
Example: | Four attributes are available to indicate which categories a document belongs to: England, France, Germany, USA In documents, you create a field that contains a comma-separated list of the categories that the documents belong to. For example, if a document belongs to the categories France and USA:
    #DREFIELD Cat="France,USA"
The following query returns documents that match the specified `Text` and contain the value France in their `Cat` field.
    action=Query&Text=presidential election&FieldText=STRING{France}:Cat

© Copyright 2020 Micro Focus or one of its affiliates | Send documentation feedback Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a mail client, and then send this email to swpdl.idoldocsfeedback@microfocus.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_FT_HTML5_bannerTitle.htm