Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GET books/_search
- {
- "query": {
- "function_score": {
- "functions": [
- {
- "field_value_factor": {
- "field": "popularity",
- "factor": 1,
- "modifier": "ln2p",
- "missing": 1
- },
- "weight": 1
- },
- {
- "field_value_factor": {
- "field": "pageViewsLast30",
- "factor": 1,
- "modifier": "ln2p",
- "missing": 1
- },
- "weight": 1
- }
- ],
- "query": {
- "bool": {
- "filter": [
- {
- "bool": {
- "must": [
- {
- "term": {
- "isActive": {
- "value": true
- }
- }
- }
- ]
- }
- }
- ],
- "should": [
- {
- "match": {
- "title.keyword": {
- "query": "starship troopers",
- "boost": 25
- }
- }
- },
- {
- "match": {
- "title.text": {
- "query": "starship troopers",
- "minimum_should_match": "100%"
- }
- }
- },
- {
- "match": {
- "title.text": {
- "query": "starship troopers",
- "analyzer": "stop",
- "minimum_should_match": "100%"
- }
- }
- },
- {
- "match": {
- "title": {
- "query": "starship troopers",
- "analyzer": "stop",
- "minimum_should_match": "80%"
- }
- }
- },
- {
- "match": {
- "title": {
- "query": "starship troopers",
- "analyzer": "stop",
- "minimum_should_match": "-40%"
- }
- }
- },
- {
- "match": {
- "title": {
- "query": "starship troopers",
- "analyzer": "stop"
- }
- }
- },
- {
- "match": {
- "url.keyword": {
- "query": "\/books\/starship troopers"
- }
- }
- },
- {
- "match": {
- "url.keyword": {
- "query": "\/books\/starship troopers",
- "analyzer": "stop"
- }
- }
- },
- {
- "match": {
- "url.keyword": {
- "query": "\/books\/starship troopers",
- "boost": 25
- }
- }
- },
- {
- "match": {
- "url.text": {
- "query": "starship troopers",
- "analyzer": "stop",
- "minimum_should_match": "100%"
- }
- }
- },
- {
- "match": {
- "url.text": {
- "query": "starship troopers",
- "analyzer": "stop",
- "minimum_should_match": "80%"
- }
- }
- },
- {
- "match": {
- "url.keyword": {
- "query": "\/books\/starship troopers"
- }
- }
- },
- {
- "match": {
- "author.keyword": {
- "query": "starship troopers"
- }
- }
- },
- {
- "match": {
- "author.text": {
- "query": "starship troopers",
- "analyzer": "stop",
- "minimum_should_match": "100%"
- }
- }
- }
- ]
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement