# 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      |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.ajaxsearchpro.com/behavior/search-logic/search-logics-explained.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
