简体   繁体   English

google app引擎中search.get_indexes()返回结果的排序顺序是什么?

[英]What is the sort order of returned results for search.get_indexes() in google app engine?

I am using the search.get_indexes() function as documented here , to get the list of search indexes that I have stored. 我正在使用此处记录的search.get_indexes()函数来获取已存储的搜索索引列表。 From a few test cases, it seems that the returned list is sorted alphabetically on the Index name. 从一些测试用例看来,返回的列表似乎在索引名称上按字母顺序排序。 Is it known or documented that this behaviour is guaranteed? 是否知道或记录了这种行为得到保证? I might have missed something, but I couldn't find it explicitly mentioned in the docs. 我可能错过了一些内容,但是找不到文档中明确提及的内容。 Thanks in advance. 提前致谢。

If the sort order is not specified in the documentation, it is not guaranteed, and the implementation may change going forward. 如果未在文档中指定排序顺序,则不能保证排序顺序,并且实现可能会更改。 I suggest that you sort them in your code - the performance penalty is negligible, especially if the indexes are already sorted using the same criteria that you apply. 我建议您在代码中对它们进行排序-性能损失可以忽略不计,尤其是当索引已经使用所应用的相同准则进行排序时。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM