Sorting entries for putting '(1)' indexes behind keyword 1. keywords that have 'std::' in them have highest priority 2. priority if 'std::' is inside their name 3. sorting by keyword 4. sorting by name
(entry)
| 42 | |
| 43 | |
| 44 | def _sort_crawl(entry): |
| 45 | """ Sorting entries for putting '(1)' indexes behind keyword |
| 46 | |
| 47 | 1. keywords that have 'std::' in them have highest priority |
| 48 | 2. priority if 'std::' is inside their name |
| 49 | 3. sorting by keyword |
| 50 | 4. sorting by name |
| 51 | """ |
| 52 | id, title, keyword, count = entry |
| 53 | hasStd1 = keyword.find("std::") |
| 54 | if hasStd1 == -1: |
| 55 | hasStd1 = 1 |
| 56 | else: |
| 57 | hasStd1 = 0 |
| 58 | |
| 59 | hasStd2 = title.find("std::") |
| 60 | if hasStd2 == -1: |
| 61 | hasStd2 = 1 |
| 62 | else: |
| 63 | hasStd2 = 0 |
| 64 | |
| 65 | return (hasStd1, hasStd2, keyword, title) |
| 66 | |
| 67 | |
| 68 | def _sort_search(entry, pattern): |