elasticsearch - Sort not working as expected -


i having issue sorting query results. essentially, query should return events (metatype field) based on relevance , sorted date, newest first. when put sort in query, returns same exact results, regardless of query is.

this query. can see i'm doing wrong here? thank in advance.

"query": {

                    "bool": {                           "should": [                             { "match": {                                  "sortabletitle":  {                                   "query": query,                                    "operator": "and"                             }}},                             { "match": {                                  "content":  {                                   "query": query,                                    "operator": "or"                             }}},                             { "match": {                                  "description":  {                                   "query": query,                                    "operator": "or"                             }}},                           ],                             "must": {                                 "match": {                                 "metatype":{                                     "query": "event"                             }}},                         },//end bool                          },//end query                    "sort": [                       { "created":   { "order": "desc" }},                       { "_score": { "order": "desc" }}                       ] 


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -