forked from organicmaps/organicmaps
[geocoder] Add shuffle match ('Аэропортовская 1-я' and '1-я Аэропортовская')
This commit is contained in:
parent
8fdaabf361
commit
ea4788da28
1 changed files with 7 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
|||
#include "base/logging.hpp"
|
||||
#include "base/string_utils.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <atomic>
|
||||
#include <cstddef>
|
||||
#include <mutex>
|
||||
|
@ -43,7 +44,12 @@ Index::Doc const & Index::GetDoc(DocId const id) const
|
|||
// static
|
||||
string Index::MakeIndexKey(Tokens const & tokens)
|
||||
{
|
||||
return strings::JoinStrings(tokens, " ");
|
||||
if (tokens.size() == 1 || std::is_sorted(begin(tokens), end(tokens)))
|
||||
return strings::JoinStrings(tokens, " ");
|
||||
|
||||
auto indexTokens = tokens;
|
||||
std::sort(begin(indexTokens), end(indexTokens));
|
||||
return strings::JoinStrings(indexTokens, " ");
|
||||
}
|
||||
|
||||
void Index::AddEntries()
|
||||
|
|
Loading…
Add table
Reference in a new issue