# Example Dynamic Promotion Rule

The following QMS rule returns when you send a query for promotions that contains one or more of the terms orange, melon, or fruit in the query text. QMS then returns the results of an IDOL Server query for the text pumpkin from the `food` database.

    #DREREFERENCE dynamic_promotion
    #DRETITLE dynamic_promo_1
    #DREDBNAME ACTIVATED
    #DREFIELD QMSAGENTBOOL="orange OR melon OR fruit"
    #DREFIELD DYNAMIC_DATABASEMATCH="food"
    #DREFIELD PROMOTION_NAME="Top promotions"
    #DREFIELD QMSTYPE="3"
    #DREFIELD DYNAMIC_QUERY_TEXT="pumpkin"
    #DREFIELD FIELDTEXTRESTRICTION="MATCH{fruit}:TYPE"
    #DREFIELD ALWAYSACTIVE="True"
    #DRECONTENT
    ORANGE MELON FRUIT
    #DREENDDOC

For example, the following query to QMS returns this promotion:

    action=Query&Text=melon&Promotions=True

It sends the following query to IDOL Server to retrieve the promotion documents:

    action=Query&Text=pumpkin&FieldText=MATCH{fruit}:TYPE&DatabaseMatch=food

NOTE: For queries where a synonym rule database restriction applies, you can specify multiple databases in the `DatabaseMatch` request parameter by separating them with a plus symbol or a space.

_FT_HTML5_bannerTitle.htm