Search throw multiple fields on a document

Hey!

Well, I'm a new Elastic Search user and I'd like to know how to query on multiple fields at a document inside Elastic with just on text input.

Consider these documents:

{
   "description": "Some pretty nice description",
   "color": "white",
   "category": "electronic"
},
{
   "description": "Some strange description",
   "color": "black",
   "category": "electronic"
},

If I type some white electronic it should return the first one. If I type black electronic it should return the second one.

What I've seen so far at docs is that is possible to filter by each field but how to search over all of them?

Thanks!

You probably want to use copy_to to create a single field that can be searched across, check out https://www.elastic.co/guide/en/elasticsearch/reference/6.6/copy-to.html

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.