Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search with sort field of score fails #83

Closed
clintongormley opened this issue Mar 22, 2010 · 3 comments
Closed

Search with sort field of score fails #83

clintongormley opened this issue Mar 22, 2010 · 3 comments

Comments

@clintongormley
Copy link

Hiya

I've managed to replicate the RemoteTransportException that doesn't include the actual exception.

Start two nodes on localhost, then run this script:

curl -XGET 'http://127.0.0.1:9200/_cluster/nodes' 


curl -XPUT 'http://127.0.0.2:9200/ia_object/notice/_mapping?ignoreConflicts=false'  -d '
{
   "allField" : {
      "store" : "yes",
      "termVector" : "with_positions_offsets",
      "enabled" : 1
   },
   "properties" : {
      "notice_type" : {
         "index" : "not_analyzed",
         "type" : "string"
      },
      "ancestor_ids" : {
         "type" : "long"
      },
      "status" : {
         "index" : "not_analyzed",
         "type" : "string"
      },
      "location_ids" : {
         "type" : "long",
         "indexName" : "location_id"
      },
      "remote_last_modified" : {
         "format" : "yyyy-MM-dd HH:mm:ss",
         "type" : "date"
      },
      "parent_id" : {
         "type" : "long"
      },
      "featured" : {
         "type" : "boolean"
      },
      "publish_date" : {
         "format" : "yyyy-MM-dd HH:mm:ss",
         "type" : "date"
      },
      "text" : {
         "type" : "string"
      },
      "id" : {
         "type" : "long"
      },
      "creator_id" : {
         "nullValue" : 0,
         "type" : "long"
      },
      "last_modified" : {
         "format" : "yyyy-MM-dd HH:mm:ss",
         "type" : "date"
      },
      "name" : {
         "boost" : "1.2",
         "type" : "string"
      },
      "has_name" : {
         "type" : "boolean"
      },
      "created" : {
         "format" : "yyyy-MM-dd HH:mm:ss",
         "type" : "date"
      },
      "sub_type" : {
         "index" : "not_analyzed",
         "type" : "string"
      }
   }
}
'


curl -XPUT 'http://127.0.0.2:9200/ia_object/notice/754'  -d '
{
   "notice_type" : "all_birthday",
   "ancestor_ids" : [
      "268",
      "23",
      "22"
   ],
   "status" : "active",
   "last_modified" : "2010-01-11 18:47:46",
   "name" : "",
   "location_ids" : [
      "23",
      "24",
      "30"
   ],
   "remote_last_modified" : "2007-02-14 18:10:00",
   "parent_id" : "268",
   "has_name" : 0,
   "created" : "2010-01-11 18:47:46",
   "featured" : 0,
   "sub_type" : "birthday",
   "publish_date" : "2007-02-13 00:00:00",
   "text" : "happy 21st birthday katie nicholas\nWe wish you good health and happiness for your future.\nLove, Nan and Gran (Dad) XX.\nWill be loving you always.",
   "id" : "754",
   "creator_id" : 0
}
'


curl -XPUT 'http://127.0.0.2:9200/ia_object/notice/755'  -d '
{
   "notice_type" : "all_birthday",
   "ancestor_ids" : [
      "268",
      "23",
      "22"
   ],
   "status" : "active",
   "last_modified" : "2010-01-11 18:47:46",
   "name" : "",
   "location_ids" : [
      "23",
      "24",
      "30"
   ],
   "remote_last_modified" : "2007-02-14 18:10:00",
   "parent_id" : "268",
   "has_name" : 0,
   "created" : "2010-01-11 18:47:46",
   "featured" : 0,
   "sub_type" : "birthday",
   "publish_date" : "2007-02-13 00:00:00",
   "id" : "755",
   "creator_id" : 0
}
'


curl -XPUT 'http://127.0.0.2:9200/ia_object/notice/756'  -d '
{
   "notice_type" : "all_birthday",
   "ancestor_ids" : [
      "268",
      "23",
      "22"
   ],
   "status" : "active",
   "last_modified" : "2010-01-11 18:47:46",
   "name" : "",
   "location_ids" : [
      "23",
      "24",
      "30"
   ],
   "remote_last_modified" : "2007-02-14 18:10:00",
   "parent_id" : "268",
   "has_name" : 0,
   "created" : "2010-01-11 18:47:46",
   "featured" : 0,
   "sub_type" : "birthday",
   "publish_date" : "2007-02-13 00:00:00",
   "text" : "HAPPY 18TH BIRTHDAY ROSHENE SMITH To a wonderful daughter. Enjoy your day. Lots of love. Mum and Dad XX.\nHappy Birthday Roshene. Legal at last!!\nNow the drinks are on you, not us.\nLove from Saffron and Grandma XX.",
   "id" : "756",
   "creator_id" : 0
}
'


curl -XPUT 'http://127.0.0.2:9200/ia_object/notice/757'  -d '
{
   "notice_type" : "all_birthday",
   "ancestor_ids" : [
      "268",
      "23",
      "22"
   ],
   "status" : "active",
   "last_modified" : "2010-01-11 18:47:46",
   "name" : "",
   "location_ids" : [
      "23",
      "24",
      "30"
   ],
   "remote_last_modified" : "2007-02-14 18:10:00",
   "parent_id" : "268",
   "has_name" : 0,
   "created" : "2010-01-11 18:47:46",
   "featured" : 0,
   "sub_type" : "birthday",
   "publish_date" : "2007-02-13 00:00:00",
   "text" : "happy 18th birthday david and ashley donald Our precious babies all grown up now. We love you both so much. All our love. Mum, Dad, James, Lucy and Daisy XXXX.\nP.S. Congratulations to both of you for being accepted into The Camelia Botnar Foundation.\nWe are so proud of you.",
   "id" : "757",
   "creator_id" : 0
}
'


curl -XPUT 'http://127.0.0.2:9200/ia_object/notice/758'  -d '
{
   "notice_type" : "all_birthday",
   "ancestor_ids" : [
      "268",
      "23",
      "22"
   ],
   "status" : "active",
   "last_modified" : "2010-01-11 18:47:46",
   "name" : "",
   "location_ids" : [
      "23",
      "24",
      "30"
   ],
   "remote_last_modified" : "2007-02-14 18:10:00",
   "parent_id" : "268",
   "has_name" : 0,
   "created" : "2010-01-11 18:47:46",
   "featured" : 0,
   "sub_type" : "birthday",
   "publish_date" : "2007-02-13 00:00:00",
   "text" : "happy 18th birthday ashley and david donald TWINS.\nHave a lovely birthday now it is all legal. Ha Ha. Lots of love and kisses. Nan XXXXX.",
   "id" : "758",
   "creator_id" : 0
}
'


curl -XGET 'http://127.0.0.2:9201/ia_object/notice/_search?searchType=dfs_query_then_fetch&pretty=1'  -d '
{
   "sort" : [
      "score"
   ],
   "fields" : [],
   "query" : {
      "filteredQuery" : {
         "filter" : {
            "term" : {
               "status" : "active"
            }
         },
         "query" : {
            "queryString" : {
               "query" : "happy"
            }
         }
      }
   }
}
'

curl -XGET 'http://127.0.0.2:9200/ia_object/notice/_search?searchType=dfs_query_then_fetch&pretty=1'  -d '
{
   "sort" : [
      "score"
   ],
   "fields" : [],
   "query" : {
      "filteredQuery" : {
         "filter" : {
            "term" : {
               "status" : "active"
            }
         },
         "query" : {
            "queryString" : {
               "query" : "happy"
            }
         }
      }
   }
}
'
@clintongormley
Copy link
Author

This seems to be the cause of the bad total values too - some shards fail, and the returned hits are less than estimated:

Try this script - i add various docs, do a search on both nodes, sleep, repeat the search, add another doc and repeat the search:

curl -XPUT 'http://127.0.0.2:9200/ia_object/notice/_mapping?ignoreConflicts=false'  -d '
{
   "allField" : {
      "store" : "yes",
      "termVector" : "with_positions_offsets",
      "enabled" : 1
   },
   "properties" : {
      "notice_type" : {
         "index" : "not_analyzed",
         "type" : "string"
      },
      "ancestor_ids" : {
         "type" : "long"
      },
      "status" : {
         "index" : "not_analyzed",
         "type" : "string"
      },
      "location_ids" : {
         "type" : "long",
         "indexName" : "location_id"
      },
      "remote_last_modified" : {
         "format" : "yyyy-MM-dd HH:mm:ss",
         "type" : "date"
      },
      "parent_id" : {
         "type" : "long"
      },
      "featured" : {
         "type" : "boolean"
      },
      "publish_date" : {
         "format" : "yyyy-MM-dd HH:mm:ss",
         "type" : "date"
      },
      "text" : {
         "type" : "string"
      },
      "id" : {
         "type" : "long"
      },
      "creator_id" : {
         "nullValue" : 0,
         "type" : "long"
      },
      "last_modified" : {
         "format" : "yyyy-MM-dd HH:mm:ss",
         "type" : "date"
      },
      "name" : {
         "boost" : "1.2",
         "type" : "string"
      },
      "has_name" : {
         "type" : "boolean"
      },
      "created" : {
         "format" : "yyyy-MM-dd HH:mm:ss",
         "type" : "date"
      },
      "sub_type" : {
         "index" : "not_analyzed",
         "type" : "string"
      }
   }
}
'


curl -XPUT 'http://127.0.0.2:9200/ia_object/notice/754'  -d '
{
   "notice_type" : "all_birthday",
   "ancestor_ids" : [
      "268",
      "23",
      "22"
   ],
   "status" : "active",
   "last_modified" : "2010-01-11 18:47:46",
   "name" : "",
   "location_ids" : [
      "23",
      "24",
      "30"
   ],
   "remote_last_modified" : "2007-02-14 18:10:00",
   "parent_id" : "268",
   "has_name" : 0,
   "created" : "2010-01-11 18:47:46",
   "featured" : 0,
   "sub_type" : "birthday",
   "publish_date" : "2007-02-13 00:00:00",
   "text" : "happy 21st birthday katie nicholas\nWe wish you good health and happiness for your future.\nLove, Nan and Gran (Dad) XX.\nWill be loving you always.",
   "id" : "754",
   "creator_id" : 0
}
'


curl -XPUT 'http://127.0.0.2:9200/ia_object/notice/755'  -d '
{
   "notice_type" : "all_birthday",
   "ancestor_ids" : [
      "268",
      "23",
      "22"
   ],
   "status" : "active",
   "last_modified" : "2010-01-11 18:47:46",
   "name" : "",
   "location_ids" : [
      "23",
      "24",
      "30"
   ],
   "remote_last_modified" : "2007-02-14 18:10:00",
   "parent_id" : "268",
   "has_name" : 0,
   "created" : "2010-01-11 18:47:46",
   "featured" : 0,
   "sub_type" : "birthday",
   "publish_date" : "2007-02-13 00:00:00",
   "id" : "755",
   "creator_id" : 0
}
'


curl -XPUT 'http://127.0.0.2:9200/ia_object/notice/756'  -d '
{
   "notice_type" : "all_birthday",
   "ancestor_ids" : [
      "268",
      "23",
      "22"
   ],
   "status" : "active",
   "last_modified" : "2010-01-11 18:47:46",
   "name" : "",
   "location_ids" : [
      "23",
      "24",
      "30"
   ],
   "remote_last_modified" : "2007-02-14 18:10:00",
   "parent_id" : "268",
   "has_name" : 0,
   "created" : "2010-01-11 18:47:46",
   "featured" : 0,
   "sub_type" : "birthday",
   "publish_date" : "2007-02-13 00:00:00",
   "text" : "HAPPY 18TH BIRTHDAY ROSHENE SMITH To a wonderful daughter. Enjoy your day. Lots of love. Mum and Dad XX.\nHappy Birthday Roshene. Legal at last!!\nNow the drinks are on you, not us.\nLove from Saffron and Grandma XX.",
   "id" : "756",
   "creator_id" : 0
}
'


curl -XPUT 'http://127.0.0.2:9200/ia_object/notice/757'  -d '
{
   "notice_type" : "all_birthday",
   "ancestor_ids" : [
      "268",
      "23",
      "22"
   ],
   "status" : "active",
   "last_modified" : "2010-01-11 18:47:46",
   "name" : "",
   "location_ids" : [
      "23",
      "24",
      "30"
   ],
   "remote_last_modified" : "2007-02-14 18:10:00",
   "parent_id" : "268",
   "has_name" : 0,
   "created" : "2010-01-11 18:47:46",
   "featured" : 0,
   "sub_type" : "birthday",
   "publish_date" : "2007-02-13 00:00:00",
   "text" : "happy 18th birthday david and ashley donald Our precious babies all grown up now. We love you both so much. All our love. Mum, Dad, James, Lucy and Daisy XXXX.\nP.S. Congratulations to both of you for being accepted into The Camelia Botnar Foundation.\nWe are so proud of you.",
   "id" : "757",
   "creator_id" : 0
}
'


curl -XPUT 'http://127.0.0.2:9200/ia_object/notice/758'  -d '
{
   "notice_type" : "all_birthday",
   "ancestor_ids" : [
      "268",
      "23",
      "22"
   ],
   "status" : "active",
   "last_modified" : "2010-01-11 18:47:46",
   "name" : "",
   "location_ids" : [
      "23",
      "24",
      "30"
   ],
   "remote_last_modified" : "2007-02-14 18:10:00",
   "parent_id" : "268",
   "has_name" : 0,
   "created" : "2010-01-11 18:47:46",
   "featured" : 0,
   "sub_type" : "birthday",
   "publish_date" : "2007-02-13 00:00:00",
   "text" : "happy 18th birthday ashley and david donald TWINS.\nHave a lovely birthday now it is all legal. Ha Ha. Lots of love and kisses. Nan XXXXX.",
   "id" : "758",
   "creator_id" : 0
}
'


curl -XGET 'http://127.0.0.2:9201/ia_object/notice/_search?searchType=dfs_query_then_fetch&pretty=1'  -d '
{
   "sort" : [
      "score"
   ],
   "fields" : [],
   "query" : {
      "filteredQuery" : {
         "filter" : {
            "term" : {
               "status" : "active"
            }
         },
         "query" : {
            "queryString" : {
               "query" : "happy"
            }
         }
      }
   }
}
'

curl -XGET 'http://127.0.0.2:9200/ia_object/notice/_search?searchType=dfs_query_then_fetch&pretty=1'  -d '
{
   "sort" : [
      "score"
   ],
   "fields" : [],
   "query" : {
      "filteredQuery" : {
         "filter" : {
            "term" : {
               "status" : "active"
            }
         },
         "query" : {
            "queryString" : {
               "query" : "happy"
            }
         }
      }
   }
}
'

sleep 1;

curl -XGET 'http://127.0.0.2:9201/ia_object/notice/_search?searchType=dfs_query_then_fetch&pretty=1'  -d '
{
   "sort" : [
      "score"
   ],
   "fields" : [],
   "query" : {
      "filteredQuery" : {
         "filter" : {
            "term" : {
               "status" : "active"
            }
         },
         "query" : {
            "queryString" : {
               "query" : "happy"
            }
         }
      }
   }
}
'

curl -XGET 'http://127.0.0.2:9200/ia_object/notice/_search?searchType=dfs_query_then_fetch&pretty=1'  -d '
{
   "sort" : [
      "score"
   ],
   "fields" : [],
   "query" : {
      "filteredQuery" : {
         "filter" : {
            "term" : {
               "status" : "active"
            }
         },
         "query" : {
            "queryString" : {
               "query" : "happy"
            }
         }
      }
   }
}
'

curl -XPUT 'http://127.0.0.2:9200/ia_object/notice/759'  -d '
{
   "notice_type" : "all_birthday",
   "ancestor_ids" : [
      "268",
      "23",
      "22"
   ],
   "status" : "active",
   "last_modified" : "2010-01-11 18:47:46",
   "name" : "",
   "location_ids" : [
      "23",
      "24",
      "30"
   ],
   "remote_last_modified" : "2007-02-14 18:10:00",
   "parent_id" : "268",
   "has_name" : 0,
   "created" : "2010-01-11 18:47:46",
   "featured" : 0,
   "sub_type" : "birthday",
   "publish_date" : "2007-02-13 00:00:00",
   "text" : "happy 21st birthday katie nicholas\nWe wish you good health and happiness for your future.\nLove, Nan and Gran (Dad) XX.\nWill be loving you always.",
   "id" : "754",
   "creator_id" : 0
}
'
curl -XGET 'http://127.0.0.2:9201/ia_object/notice/_search?searchType=dfs_query_then_fetch&pretty=1'  -d '
{
   "sort" : [
      "score"
   ],
   "fields" : [],
   "query" : {
      "filteredQuery" : {
         "filter" : {
            "term" : {
               "status" : "active"
            }
         },
         "query" : {
            "queryString" : {
               "query" : "happy"
            }
         }
      }
   }
}
'

curl -XGET 'http://127.0.0.2:9200/ia_object/notice/_search?searchType=dfs_query_then_fetch&pretty=1'  -d '
{
   "sort" : [
      "score"
   ],
   "fields" : [],
   "query" : {
      "filteredQuery" : {
         "filter" : {
            "term" : {
               "status" : "active"
            }
         },
         "query" : {
            "queryString" : {
               "query" : "happy"
            }
         }
      }
   }
}
'

@kimchy
Copy link
Member

kimchy commented Mar 23, 2010

Fixed, can you verify?

@clintongormley
Copy link
Author

Fixed+++ Sheer genius :)

dadoonet added a commit that referenced this issue Jun 5, 2015
Closes #83.

(cherry picked from commit 67ac149)
dadoonet added a commit that referenced this issue Jun 5, 2015
rmuir pushed a commit to rmuir/elasticsearch that referenced this issue Nov 8, 2015
 As seen with elastic#7474, we need to update mapper attachment plugin with this new signature.

 Closes elastic#83.
ClaudioMFreitas pushed a commit to ClaudioMFreitas/elasticsearch-1 that referenced this issue Nov 12, 2019
Merged debian init script changes from elasticsearch
henningandersen pushed a commit to henningandersen/elasticsearch that referenced this issue Jun 4, 2020
With this commit we remove a few challenges that were created for
specific investigations reducing the complexity of this track.

Closes elastic#74
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this issue Oct 2, 2023
With this commit we get rid of all string-based representation of more complex
parameters. This affects track-params and car-params specifically which will
now be passed to Rally as JSON string in any case. This allows to merge those
parameters in more complex scenarios where we need to source them from multiple
places.

Closes elastic#82
Relates elastic#83
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants