-
-
Save nulpunkt/3dd19b8c187efbc962ee3f0eef5b491d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"query": { | |
"function_score": { | |
"filter": { | |
"and": [ | |
{ | |
"terms": { | |
"group_id": [ | |
"576878" | |
] | |
} | |
} | |
] | |
}, | |
"query": { | |
"bool": { | |
"minimum_should_match": 1, | |
"must_not": [ | |
{ | |
"match": { | |
"title": { | |
"query": "" | |
} | |
} | |
}, | |
{ | |
"match": { | |
"filename": { | |
"query": "" | |
} | |
} | |
}, | |
{ | |
"match": { | |
"filename": { | |
"query": "" | |
} | |
} | |
}, | |
{ | |
"match": { | |
"uploaded_by": { | |
"query": "" | |
} | |
} | |
}, | |
{ | |
"match": { | |
"description": { | |
"query": "" | |
} | |
} | |
}, | |
{ | |
"match": { | |
"copyright": { | |
"query": "" | |
} | |
} | |
}, | |
{ | |
"match": { | |
"keywords": { | |
"query": "" | |
} | |
} | |
} | |
], | |
"should": [ | |
{ | |
"match_phrase_prefix": { | |
"title": { | |
"query": "stnahoeu" | |
} | |
} | |
}, | |
{ | |
"match_phrase_prefix": { | |
"filename": { | |
"query": "stnahoeu" | |
} | |
} | |
}, | |
{ | |
"match": { | |
"filename": { | |
"query": "stnahoeu" | |
} | |
} | |
}, | |
{ | |
"match_phrase": { | |
"uploaded_by": { | |
"query": "stnahoeu" | |
} | |
} | |
}, | |
{ | |
"match_phrase_prefix": { | |
"description": { | |
"query": "stnahoeu" | |
} | |
} | |
}, | |
{ | |
"match": { | |
"copyright": { | |
"query": "stnahoeu" | |
} | |
} | |
}, | |
{ | |
"match": { | |
"byline": { | |
"query": "stnahoeu" | |
} | |
} | |
}, | |
{ | |
"match_phrase_prefix": { | |
"title": { | |
"query": "newkeyword" | |
} | |
} | |
}, | |
{ | |
"match_phrase_prefix": { | |
"filename": { | |
"query": "newkeyword" | |
} | |
} | |
}, | |
{ | |
"match": { | |
"filename": { | |
"query": "newkeyword" | |
} | |
} | |
}, | |
{ | |
"match_phrase": { | |
"uploaded_by": { | |
"query": "newkeyword" | |
} | |
} | |
}, | |
{ | |
"match_phrase_prefix": { | |
"description": { | |
"query": "newkeyword" | |
} | |
} | |
}, | |
{ | |
"match": { | |
"copyright": { | |
"query": "newkeyword" | |
} | |
} | |
}, | |
{ | |
"match": { | |
"byline": { | |
"query": "newkeyword" | |
} | |
} | |
}, | |
{ | |
"match": { | |
"keywords": { | |
"boost": 8, | |
"query": [ | |
"stnahoeu", | |
"newkeyword" | |
] | |
} | |
} | |
}, | |
{ | |
"match": { | |
"keywords": { | |
"operator": "and", | |
"query": [ | |
"stnahoeu", | |
"newkeyword" | |
] | |
} | |
} | |
} | |
] | |
} | |
} | |
} | |
}, | |
"sort": [ | |
{ | |
"_script": { | |
"lang": "groovy", | |
"order": "desc", | |
"script": "if (_source['title'] && _source['title'].trim())\n _source['title'].trim().toLowerCase() else _source['filename'].trim().toLowerCase()", | |
"type": "string" | |
} | |
}, | |
"unique_media_id" | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment