I need to combine 2 queries and I am not sure how to do it. I have one field which has site names (we have few properties that I am scraping and putting cleaned html from it into Elastic Search) and few other fields (content, description, etc). So when I search I would like to search for specific site and then search for keywords in other fields. How would I get around doing this?
Here is the mapping
{
"media": {
"aliases": {},
"mappings": {
"articles": {
"properties": {
"author": {
"type": "keyword"
},
"cmskeywords": {
"type": "text"
},
"content": {
"type": "text",
"analyzer": "lowercasespaceanalyzer"
},
"description": {
"type": "text"
},
"imageUrl": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"imageurl": {
"type": "keyword"
},
"partNumbers": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"partnumbers": {
"type": "keyword"
},
"pubdate": {
"type": "date"
},
"relatedcontentwords": {
"type": "text"
},
"site": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"title": {
"type": "text"
},
"url": {
"type": "keyword"
}
}
}
},
"settings": {
"index": {
"number_of_shards": "5",
"provided_name": "media",
"creation_date": "1522284975992",
"analysis": {
"analyzer": {
"lowercasespaceanalyzer": {
"filter": [
"lowercase"
],
"type": "custom",
"tokenizer": "whitespace"
}
}
},
"number_of_replicas": "1",
"uuid": "Qz8JbotxQee6Dihll3uBSQ",
"version": {
"created": "6020299"
}
}
}
}
}
Here are 2 DSL queries
{
"query": {
"match": {
"site": {
"query": "EBN",
"type": "phrase"
}
}
}
{
"query": {
"match": {
"site": {
"query": "EBN",
"type": "phrase"
}
}
}