| 795 | } |
| 796 | |
| 797 | void Processor::InitParams(QueryParams & params) const |
| 798 | { |
| 799 | /// @todo Prettify |
| 800 | params.Init(m_query.m_query, m_query.m_tokens.begin(), m_query.m_tokens.end(), m_query.m_prefix); |
| 801 | |
| 802 | Classificator const & c = classif(); |
| 803 | |
| 804 | // Add names of categories (and synonyms). |
| 805 | QuerySliceOnRawStrings const tokenSlice(m_query.m_tokens, m_query.m_prefix); |
| 806 | params.SetCategorialRequest(m_isCategorialRequest); |
| 807 | if (m_isCategorialRequest) |
| 808 | { |
| 809 | for (auto const type : m_preferredTypes) |
| 810 | { |
| 811 | uint32_t const index = c.GetIndexForType(type); |
| 812 | for (size_t i = 0; i < tokenSlice.Size(); ++i) |
| 813 | params.GetTypeIndices(i).push_back(index); |
| 814 | } |
| 815 | } |
| 816 | else |
| 817 | { |
| 818 | ForEachCategoryTypeFuzzy(tokenSlice, [&c, ¶ms](size_t i, uint32_t t) |
| 819 | { |
| 820 | if (!ftypes::IsNationalCuisineChecker::Instance()(t)) { |
| 821 | uint32_t const index = c.GetIndexForType(t); |
| 822 | params.GetTypeIndices(i).push_back(index); |
| 823 | } |
| 824 | }); |
| 825 | } |
| 826 | |
| 827 | // Remove all type indices for streets, as they're considired individually. |
| 828 | params.ClearStreetIndices(); |
| 829 | |
| 830 | for (size_t i = 0; i < params.GetNumTokens(); ++i) |
| 831 | base::SortUnique(params.GetTypeIndices(i)); |
| 832 | |
| 833 | m_keywordsScorer.ForEachLanguage([¶ms](int8_t lang) { params.GetLangs().insert(static_cast<uint64_t>(lang)); }); |
| 834 | } |
| 835 | |
| 836 | void Processor::InitGeocoder(Geocoder::Params & geocoderParams, SearchParams const & searchParams) |
| 837 | { |
nothing calls this directly
no test coverage detected