# Search logics explained

The logic on the same or across the separate fields for each keyword (title, content, excerpt etc..)

## OR

Match is found if any of the search keywords is part of the content. It's the least strict of all possible options - it returns many results, finds almost anything.

| Keyword        | Fields                                                                                                                                      | Match? |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------ |
| hello          | <p><em>Post Title:</em><br><strong>Hello</strong> big world!</p><p><br><em>Post Content:</em> <br>Robot here!</p>                           | YES    |
| hello wor      | <p><em>Post Title:</em></p><p><strong>Hello</strong> big <strong>wor</strong>ld!</p><p></p><p><em>Post Content:</em> </p><p>Robot here!</p> | YES    |
| hello robot    | <p><em>Post Title:</em></p><p><strong>Hello</strong> big world!</p><p></p><p><em>Post Content:</em></p><p><strong>Robot</strong> here!</p>  | YES    |
| hel bot        | <p><em>Post Title:</em></p><p><strong>Hel</strong>lo big world!</p><p></p><p><em>Post Content:</em></p><p>Ro<strong>bot</strong> here!</p>  | YES    |
| help bot hello | <p><em>Post Title:</em></p><p><strong>Hello</strong> big world!</p><p></p><p><em>Post Content:</em></p><p>Ro<strong>bo</strong>t here!</p>  | YES    |
| hello science  | <p><em>Post Title:</em></p><p><strong>Hello</strong> big world!</p><p></p><p><em>Post Content:</em></p><p>Robot here!</p>                   | YES    |

## OR with exact word matches

Similar to the simple OR, but at least one keyword must match a whole word. Partial results are not accepted.

| Keyword        | Fields                                                                                                                                      | Match?                                   |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- |
| hello          | <p><em>Post Title:</em><br><strong>Hello</strong> big world!</p><p><br><em>Post Content:</em> <br>Robot here!</p>                           | YES                                      |
| hello wor      | <p><em>Post Title:</em></p><p><strong>Hello</strong> big <strong>wor</strong>ld!</p><p></p><p><em>Post Content:</em> </p><p>Robot here!</p> | YES                                      |
| hello robot    | <p><em>Post Title:</em></p><p><strong>Hello</strong> big world!</p><p></p><p><em>Post Content:</em></p><p><strong>Robot</strong> here!</p>  | YES                                      |
| hel bot        | <p><em>Post Title:</em></p><p><strong>Hel</strong>lo big world!</p><p></p><p><em>Post Content:</em></p><p>Ro<strong>bot</strong> here!</p>  | <p>NO</p><p>(whole word don't match)</p> |
| help bot hello | <p><em>Post Title:</em></p><p><strong>Hello</strong> big world!</p><p></p><p><em>Post Content:</em></p><p>Ro<strong>bo</strong>t here!</p>  | YES                                      |
| hello science  | <p><em>Post Title:</em></p><p><strong>Hello</strong> big world!</p><p></p><p><em>Post Content:</em></p><p>Robot here!</p>                   | YES                                      |

## AND

Every keyword must match at least partially the content.

| Keyword        | Fields                                                                                                                                      | Match?  |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| hello          | <p><em>Post Title:</em><br><strong>Hello</strong> big world!</p><p><br><em>Post Content:</em> <br>Robot here!</p>                           | YES     |
| hello wor      | <p><em>Post Title:</em></p><p><strong>Hello</strong> big <strong>wor</strong>ld!</p><p></p><p><em>Post Content:</em> </p><p>Robot here!</p> | YES     |
| hello robot    | <p><em>Post Title:</em></p><p><strong>Hello</strong> big world!</p><p></p><p><em>Post Content:</em></p><p><strong>Robot</strong> here!</p>  | **YES** |
| hel bot        | <p><em>Post Title:</em></p><p><strong>Hel</strong>lo big world!</p><p></p><p><em>Post Content:</em></p><p>Ro<strong>bot</strong> here!</p>  | **YES** |
| help bot hello | <p><em>Post Title:</em></p><p><strong>Hello</strong> big world!</p><p></p><p><em>Post Content:</em></p><p>Ro<strong>bo</strong>t here!</p>  | NO      |
| hello science  | <p><em>Post Title:</em></p><p><strong>Hello</strong> big world!</p><p></p><p><em>Post Content:</em></p><p>Robot here!</p>                   | NO      |

## AND with exact word matches

The most strict search logic. Every keyword must match a whole word in the content.

| Keyword        | Fields                                                                                                                                      | Match?  |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| hello          | <p><em>Post Title:</em><br><strong>Hello</strong> big world!</p><p><br><em>Post Content:</em> <br>Robot here!</p>                           | YES     |
| hello wor      | <p><em>Post Title:</em></p><p><strong>Hello</strong> big <strong>wor</strong>ld!</p><p></p><p><em>Post Content:</em> </p><p>Robot here!</p> | NO      |
| hello robot    | <p><em>Post Title:</em></p><p><strong>Hello</strong> big world!</p><p></p><p><em>Post Content:</em></p><p><strong>Robot</strong> here!</p>  | **YES** |
| hel bot        | <p><em>Post Title:</em></p><p><strong>Hel</strong>lo big world!</p><p></p><p><em>Post Content:</em></p><p>Ro<strong>bot</strong> here!</p>  | NO      |
| help bot hello | <p><em>Post Title:</em></p><p><strong>Hello</strong> big world!</p><p></p><p><em>Post Content:</em></p><p>Ro<strong>bo</strong>t here!</p>  | NO      |
| hello science  | <p><em>Post Title:</em></p><p><strong>Hello</strong> big world!</p><p></p><p><em>Post Content:</em></p><p>Robot here!</p>                   | NO      |
