I am creating a search on website based on ElasticSearch, and I am very new to ElasticSearch so I would be happy for any help.

This is a structure of my ElasticSearch content:

hits: 0: _index: "mysite" _type: "products" _id: "1" _score: 1 _source: name: 0: "This is name" number: "N6" status: "Y"

And this is my Perl script:

my $e = Search::Elasticsearch->new(); my $results = $e->search( index => 'mysite', type => 'products', size => 3, body => { query => { match => { name => $query } } } );

I would like to ask you how to make script that it match only products which have a status "Y" and it should find a substring of name, for example if $query contains "is", it should find that product because that product contains "is" in name "This is name", and the last one, it should search for number too, for example if $query contains "N6", it should find that product too.

So something like this: (name OR number) AND status = "Y"

Thank you very much.