# Phrase Search Examples

The word fresh stems to fresh, and the word lovely stems to love. The following words also stem to fresh and love.

TIP: To determine the stem of a word, use the `TermGetInfo` action. To determine the words to which a stem expands, use the `TermExpand` action.

FRESH | FRESHEST | FRESHLY
FRESHES | FRESHING | FRESHNESS
LOVE | LOVELY | LOVING
LOVED | LOVES | LOVINGLY
LOVELIES | LOVEST | LOVINGS

## Example 1 (Conceptual)

    action=Query&Text=fresh and Lovely

- Default matching

-     AdvancedSearch=True

-     AdvancedCaseSearch=True

The IDOL Content component matches this query conceptually in all configurations, because the phrase is not in quotation marks and none of its words are prefixed with a tilde (~).

Content first finds documents that contain both words that have the same stem as fresh and words that have the same stem as lovely (ignoring their case), and then documents that contain either words that have the same stem as fresh or words that have the same stem as lovely (ignoring their case).

Example matching words | Example nonmatching words |  | Example matching words | Example nonmatching words
--- | --- | --- | --- | ---
fresh | fresher |  | lovely | lover
freshness | freshman |  | love | lovelorn
freshly | freshwater |  | loved | loveless
freshest |  |  | loving |

## Example 2 (Conceptual or Exact)

    action=Query&Text="fresh and Lovely"

- Default matching

  In the default configuration, the quotation marks indicate that this is a phrase search. Content removes any stop words in the phrase, and applies stemming. It finds only documents in which a word whose stem matches the stem of fresh occurs immediately before a word that matches the stem of lovely (ignoring their case).

  Example matching phrases | Example nonmatching phrases
  --- | ---
  fresh lovely | freshman lover
  freshest love | fresher lovelorn
  freshly loved | lovely and fresh
  fresh and lovingly |

- `AdvancedSearch=True` or `AdvancedCaseSearch=True`

  If you set `AdvancedSearch` or `AdvancedCaseSearch` to `True`, Content removes any stop words that the phrase contains, and then matches the exact terms, because the phrase is in quotation marks. Because none of the words are prefixed with a tilde (~), it finds only documents that contain the phrase fresh lovely (ignoring its case).

  Example matching phrases | Example nonmatching phrases
  --- | ---
  fresh lovely | freshest love
  fresh and lovely | freshly loved
  fresh or lovely | fresh and lovingly
  | lovely and fresh

## Example 3 (Conceptual or Exact)

    action=Query&Text="fresh and ~Lovely"

- Default matching

  In the default configuration, the quotation marks indicate that this is a phrase search. Content ignores the tilde (~). It removes any stop words that the phrase contains, and applies stemming. It finds only documents in which a word whose stem matches the stem of fresh occurs immediately before a word that matches the stem of lovely (ignoring their case).

  Example matching phrases | Example nonmatching phrases
  --- | ---
  fresh lovely | freshman lover
  freshest love | fresher lovelorn
  freshly loved | lovely and fresh
  fresh and lovingly |

- `AdvancedSearch=True`

  If you set `AdvancedSearch` to `True`, Content removes any stop words that the phrase contains and then matches the exact terms, because the phrase is in quotation marks. It ignores the tilde (~). Content finds only documents that contain the phrase fresh lovely (ignoring its case).

  Example matching phrases | Example nonmatching phrases
  --- | ---
  fresh lovely | freshest love
  fresh and lovely | freshly loved
  fresh or lovely | fresh and lovingly
  | lovely and fresh

-     AdvancedCaseSearch=True

  If you set `AdvancedCaseSearch` to `True`, Content removes any stop words that the phrase contains and then matches the exact terms, because the phrase is in quotation marks. Because Lovely is prefixed with a tilde (~), it is matched case-sensitively. Content finds only documents that contain the phrase fresh Lovely.

  Example matching phrases | Example nonmatching phrases
  --- | ---
  fresh Lovely | fresh lovely
  fresh and Lovely | fresh and lovely
  Fresh and Lovely | fresh or lovely
  Fresh or Lovely | Lovely fresh

_FT_HTML5_bannerTitle.htm