In this chapter we will take a look how to perform a search via objective way with Elasticsearch DSL. Well, the good news is that is very simple. That's why we created this library ;).
To start a search you have to create a `Search` object.
```php
$search=newSearch();
```
> We won't include namespaces in any examples. Don't worry all class's names are unique, so any IDE editor should autocomplete and include it for you ;).
So, when we have a `Search` object we can start add something to it. Usually you will add `Query`, `Filter` and `Aggregation`.
> More info how create [queries](../Query/index.md), [filters](../Filter/index.md) and [aggregations](../Aggregation/index.md) objects.
### Form a Query
Lets take a simple query example with `MatchAllQuery`.
```php
$matchAllQuery=newMatchAllQuery();
```
To add query to the `Search` simply call `addQuery` function.
```php
$search->addQuery($matchAllQuery);
```
At the end it will form this query:
```JSON
{
"query": {
"match_all": {}
}
}
```
> There is no limits to add queries or filters or anything.
### Form a Filter
To add a filter is the same way like a query. First, lets create some `Filter` object.
```php
$matchAllFilter=newMatchAllFilter();
```
And simply add to the `Search`:
```php
$search->addFilter($matchAllFilter);
```
Unlike `Query`, when we add a `Filter` with our DSL library it will add a query and all necessary stuff for you. So when we add one filter we will get this query:
```JSON
{
"query": {
"filtered": {
"filter": {
"match_all": {}
}
}
}
}
```
### Multpile queries and filters
As you know there is possible to use multiple filters and queries in elasticsearch. No problem, if you have several filters just add it to the search. `ElasticsearchDSL` will form a `Bool` query or filter for you when you add more than one.