Multi-queries.md.json 127 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. {
  2. "b7a7236af6ab6fbced71cdb02c5d7baba8f9ce843e924bcf9e5cad5334a51007": {
  3. "original": "# Multi-queries\n\nMulti-queries, or query batches, allow you to send multiple search queries to Manticore in a single network request.\n\n\ud83d\udc4d Why use multi-queries?\n\nThe primary reason is performance. By sending requests to Manticore in a batch instead of one by one, you save time by reducing network round-trips. Additionally, sending queries in a batch allows Manticore to perform certain internal optimizations. If no batch optimizations can be applied, queries will be processed individually.\n\n\u26d4 When not to use multi-queries?\n\nMulti-queries require all search queries in a batch to be independent, which isn't always the case. Sometimes query B depends on query A's results, meaning query B can only be set up after executing query A. For example, you might want to display results from a secondary index only if no results were found in the primary table, or you may want to specify an offset into the 2nd result set based on the number of matches in the 1st result set. In these cases, you'll need to use separate queries (or separate batches).\n\n<!-- example multi-query 1 -->\nYou can run multiple search queries with SQL by separating them with a semicolon. When Manticore receives a query formatted like this from a client, all inter-statement optimizations will be applied.\n\nMulti-queries don't support queries with `FACET`. The number of multi-queries in one batch shouldn't exceed [max_batch_queries](../Server_settings/Searchd.md#max_batch_queries).\n\n\n<!-- intro -->\n##### SQL:\n\n<!-- request SQL -->\n\nCODE_BLOCK_0\n<!-- end -->\n\n## Multi-queries optimizations\n\nThere are two major optimizations to be aware of: common query optimization and common subtree optimization.\n\n**Common query optimization** means that `searchd` will identify all those queries in a batch where only the sorting and group-by settings differ, and *only perform searching once*. For example, if a batch consists of 3 queries, all of them are for \"ipod nano\", but the 1st query requests the top-10 results sorted by price, the 2nd query groups by vendor ID and requests the top-5 vendors sorted by rating, and the 3rd query requests the max price, full-text search for \"ipod nano\" will only be performed once, and its results will be reused to build 3 different result sets.\n\n[Faceted search](../Searching/Faceted_search.md) is a particularly important case that benefits from this optimization. Indeed, faceted searching can be implemented by running several queries, one to retrieve search results themselves, and a few others with the same full-text query but different group-by settings to retrieve all the required groups of results (top-3 authors, top-5 vendors, etc). As long as the full-text query and filtering settings stay the same, common query optimization will trigger, and greatly improve performance.\n\n**Common subtree optimization** is even more interesting. It allows `searchd` to exploit similarities between batched full-text queries. It identifies common full-text query parts (subtrees) in all queries and caches them between queries. For example, consider the following query batch:\n\nCODE_BLOCK_1\n\nThere's a common two-word part `donald trump` that can be computed only once, then cached and shared across the queries. And common subtree optimization does just that. Per-query cache size is strictly controlled by [subtree_docs_cache](../Server_settings/Searchd.md#subtree_docs_cache) and [subtree_hits_cache](../Server_settings/Searchd.md#subtree_hits_cache) directives (so that caching *all* sixteen gazillions of documents that match \"i am\" does not exhaust the RAM and instantly kill your server).\n\n<!-- example multi-query 2 -->\nHow can you tell if the queries in the batch were actually optimized? If they were, the respective query log will have a \"multiplier\" field that specifies how many queries were processed together:\n\nNote the \"x3\" field. It means that this query was optimized and processed in a sub-batch of 3 queries.\n\n\n<!-- intro -->\n##### log:\n\n<!-- request log -->\nCODE_BLOCK_2\n<!-- end -->\n\n<!-- example multi-query 3 -->\nFor reference, this is how the regular log would look like if the queries were not batched:\n\n\n<!-- intro -->\n##### log:\n\n<!-- request log -->\nCODE_BLOCK_3\n<!-- end -->\n\nNotice how the per-query time in the multi-query case improved by a factor of 1.5x to 2.3x, depending on the specific sorting mode.\n\n<!-- proofread -->\n\n",
  4. "translations": {
  5. "chinese": "# \u591a\u91cd\u67e5\u8be2\n\n\u591a\u91cd\u67e5\u8be2\uff0c\u4e5f\u79f0\u4e3a\u67e5\u8be2\u6279\u5904\u7406\uff0c\u5141\u8bb8\u60a8\u5728\u4e00\u6b21\u7f51\u7edc\u8bf7\u6c42\u4e2d\u5411 Manticore \u53d1\u9001\u591a\u4e2a\u641c\u7d22\u67e5\u8be2\u3002\n\n\ud83d\udc4d \u4e3a\u4ec0\u4e48\u4f7f\u7528\u591a\u91cd\u67e5\u8be2\uff1f\n\n\u4e3b\u8981\u539f\u56e0\u662f\u6027\u80fd\u3002\u901a\u8fc7\u6279\u91cf\u53d1\u9001\u8bf7\u6c42\u5230 Manticore\uff0c\u800c\u4e0d\u662f\u9010\u4e2a\u53d1\u9001\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u51cf\u5c11\u7f51\u7edc\u5f80\u8fd4\u8282\u7701\u65f6\u95f4\u3002\u6b64\u5916\uff0c\u6279\u91cf\u53d1\u9001\u67e5\u8be2\u4f7f Manticore \u80fd\u591f\u6267\u884c\u67d0\u4e9b\u5185\u90e8\u4f18\u5316\u3002\u5982\u679c\u65e0\u6cd5\u5e94\u7528\u4efb\u4f55\u6279\u5904\u7406\u4f18\u5316\uff0c\u67e5\u8be2\u5c06\u88ab\u5355\u72ec\u5904\u7406\u3002\n\n\u26d4 \u4f55\u65f6\u4e0d\u4f7f\u7528\u591a\u91cd\u67e5\u8be2\uff1f\n\n\u591a\u91cd\u67e5\u8be2\u8981\u6c42\u6279\u5904\u7406\u4e2d\u7684\u6240\u6709\u641c\u7d22\u67e5\u8be2\u76f8\u4e92\u72ec\u7acb\uff0c\u4f46\u60c5\u51b5\u5e76\u975e\u603b\u662f\u5982\u6b64\u3002\u6709\u65f6\u67e5\u8be2 B \u4f9d\u8d56\u4e8e\u67e5\u8be2 A \u7684\u7ed3\u679c\uff0c\u8fd9\u610f\u5473\u7740\u53ea\u6709\u5728\u6267\u884c\u67e5\u8be2 A \u4e4b\u540e\u624d\u80fd\u8bbe\u7f6e\u67e5\u8be2 B\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u80fd\u53ea\u5728\u4e3b\u8868\u4e2d\u672a\u627e\u5230\u7ed3\u679c\u65f6\u624d\u663e\u793a\u6765\u81ea\u4e8c\u7ea7\u7d22\u5f15\u7684\u7ed3\u679c\uff0c\u6216\u8005\u60a8\u53ef\u80fd\u5e0c\u671b\u6839\u636e\u7b2c\u4e00\u4e2a\u7ed3\u679c\u96c6\u4e2d\u7684\u5339\u914d\u6570\u91cf\uff0c\u4e3a\u7b2c\u4e8c\u4e2a\u7ed3\u679c\u96c6\u6307\u5b9a\u504f\u79fb\u91cf\u3002\u5728\u8fd9\u4e9b\u60c5\u51b5\u4e0b\uff0c\u60a8\u9700\u8981\u4f7f\u7528\u5355\u72ec\u7684\u67e5\u8be2\uff08\u6216\u5355\u72ec\u7684\u6279\u5904\u7406\uff09\u3002\n\n<!-- example multi-query 1 -->\n\u60a8\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u5206\u53f7\u5206\u9694\u6765\u8fd0\u884c\u591a\u4e2a SQL \u641c\u7d22\u67e5\u8be2\u3002\u5f53 Manticore \u4ece\u5ba2\u6237\u7aef\u63a5\u6536\u5230\u8fd9\u79cd\u683c\u5f0f\u7684\u67e5\u8be2\u65f6\uff0c\u5c06\u5e94\u7528\u6240\u6709\u8bed\u53e5\u95f4\u7684\u4f18\u5316\u3002\n\n\u591a\u91cd\u67e5\u8be2\u4e0d\u652f\u6301\u5e26\u6709 `FACET` \u7684\u67e5\u8be2\u3002\u5355\u4e2a\u6279\u5904\u7406\u4e2d\u591a\u91cd\u67e5\u8be2\u7684\u6570\u91cf\u4e0d\u5e94\u8d85\u8fc7 [max_batch_queries](../Server_settings/Searchd.md#max_batch_queries).\n\n\n<!-- intro -->\n##### SQL\uff1a\n\n<!-- request SQL -->\n\nCODE_BLOCK_0\n<!-- end -->\n\n## \u591a\u91cd\u67e5\u8be2\u4f18\u5316\n\n\u9700\u8981\u4e86\u89e3\u4e24\u79cd\u4e3b\u8981\u7684\u4f18\u5316\uff1a\u901a\u7528\u67e5\u8be2\u4f18\u5316\u548c\u901a\u7528\u5b50\u6811\u4f18\u5316\u3002\n\n**\u901a\u7528\u67e5\u8be2\u4f18\u5316** \u610f\u5473\u7740 `searchd` \u4f1a\u8bc6\u522b\u6279\u5904\u7406\u4e2d\u90a3\u4e9b\u4ec5\u5728\u6392\u5e8f\u548c group-by \u8bbe\u7f6e\u4e0a\u6709\u6240\u4e0d\u540c\u7684\u67e5\u8be2\uff0c\u5e76\u4e14*\u53ea\u6267\u884c\u4e00\u6b21\u641c\u7d22*\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4e00\u4e2a\u6279\u5904\u7406\u5305\u542b 3 \u4e2a\u67e5\u8be2\uff0c\u5b83\u4eec\u90fd\u662f\u5173\u4e8e \u201cipod nano\u201d \u7684\uff0c\u4f46\u7b2c\u4e00\u4e2a\u67e5\u8be2\u8bf7\u6c42\u6309\u4ef7\u683c\u6392\u5e8f\u7684\u524d 10 \u6761\u7ed3\u679c\uff0c\u7b2c\u4e8c\u4e2a\u67e5\u8be2\u6309\u4f9b\u5e94\u5546 ID \u5206\u7ec4\u5e76\u8bf7\u6c42\u6309\u8bc4\u5206\u6392\u5e8f\u7684\u524d 5 \u4f4d\u4f9b\u5e94\u5546\uff0c\u7b2c\u4e09\u4e2a\u67e5\u8be2\u8bf7\u6c42\u6700\u5927\u4ef7\u683c\uff0c\u90a3\u4e48\u9488\u5bf9 \u201cipod nano\u201d \u7684\u5168\u6587\u641c\u7d22\u53ea\u4f1a\u6267\u884c\u4e00\u6b21\uff0c\u5176\u7ed3\u679c\u5c06\u88ab\u91cd\u7528\u4ee5\u6784\u5efa\u4e09\u4e2a\u4e0d\u540c\u7684\u7ed3\u679c\u96c6\u3002\n\n[\u5206\u9762\u641c\u7d22](../Searching/Faceted_search.md) \u662f\u4e00\u4e2a\u7279\u522b\u91cd\u8981\u7684\u6848\u4f8b\uff0c\u80fd\u4ece\u6b64\u4f18\u5316\u4e2d\u53d7\u76ca\u3002\u5b9e\u9645\u4e0a\uff0c\u5206\u9762\u641c\u7d22\u53ef\u4ee5\u901a\u8fc7\u8fd0\u884c\u591a\u4e2a\u67e5\u8be2\u6765\u5b9e\u73b0\uff0c\u4e00\u4e2a\u7528\u4e8e\u68c0\u7d22\u641c\u7d22\u7ed3\u679c\u672c\u8eab\uff0c\u5176\u4ed6\u51e0\u4e2a\u4f7f\u7528\u76f8\u540c\u7684\u5168\u6587\u67e5\u8be2\u4f46\u4e0d\u540c\u7684 group-by \u8bbe\u7f6e\u6765\u68c0\u7d22\u6240\u6709\u6240\u9700\u7684\u7ed3\u679c\u7ec4\uff08\u524d 3 \u540d\u4f5c\u8005\u3001\u524d 5 \u540d\u4f9b\u5e94\u5546\u7b49\uff09\u3002\u53ea\u8981\u5168\u6587\u67e5\u8be2\u548c\u8fc7\u6ee4\u8bbe\u7f6e\u4fdd\u6301\u4e0d\u53d8\uff0c\u5c31\u4f1a\u89e6\u53d1\u901a\u7528\u67e5\u8be2\u4f18\u5316\uff0c\u5e76\u5927\u5e45\u63d0\u5347\u6027\u80fd\u3002\n\n**\u901a\u7528\u5b50\u6811\u4f18\u5316** \u66f4\u4e3a\u6709\u8da3\u3002\u5b83\u5141\u8bb8 `searchd` \u5229\u7528\u6279\u5904\u7406\u5168\u6587\u67e5\u8be2\u4e4b\u95f4\u7684\u76f8\u4f3c\u6027\u3002\u5b83\u4f1a\u8bc6\u522b\u6240\u6709\u67e5\u8be2\u4e2d\u5171\u540c\u7684\u5168\u6587\u67e5\u8be2\u90e8\u5206\uff08\u5b50\u6811\uff09\uff0c\u5e76\u5728\u67e5\u8be2\u4e4b\u95f4\u8fdb\u884c\u7f13\u5b58\u3002\u4f8b\u5982\uff0c\u8003\u8651\u4ee5\u4e0b\u67e5\u8be2\u6279\u5904\u7406\uff1a\n\nCODE_BLOCK_1\n\n\u6709\u4e00\u4e2a\u5171\u540c\u7684\u4e24\u8bcd\u90e8\u5206 `donald trump`\uff0c\u53ea\u9700\u8ba1\u7b97\u4e00\u6b21\uff0c\u7136\u540e\u7f13\u5b58\u5e76\u5728\u5404\u67e5\u8be2\u95f4\u5171\u4eab\u3002\u901a\u7528\u5b50\u6811\u4f18\u5316\u6b63\u662f\u8fd9\u6837\u505a\u7684\u3002\u6bcf\u4e2a\u67e5\u8be2\u7684\u7f13\u5b58\u5927\u5c0f\u7531 [subtree_docs_cache](../Server_settings/Searchd.md#subtree_docs_cache) \u548c [subtree_hits_cache](../Server_settings/Searchd.md#subtree_hits_cache) \u6307\u4ee4\u4e25\u683c\u63a7\u5236\uff08\u8fd9\u6837\u7f13\u5b58\u6240\u6709\u4e0e \u201ci am\u201d \u5339\u914d\u7684\u6d77\u91cf\u6587\u6863\u5c31\u4e0d\u4f1a\u8017\u5c3d RAM \u5e76\u77ac\u95f4\u4f7f\u670d\u52a1\u5668\u5d29\u6e83\uff09\u3002\n\n<!-- example multi-query 2 -->\n\u5982\u4f55\u5224\u65ad\u6279\u5904\u7406\u4e2d\u7684\u67e5\u8be2\u662f\u5426\u771f\u7684\u88ab\u4f18\u5316\uff1f\u5982\u679c\u88ab\u4f18\u5316\uff0c\u76f8\u5173\u67e5\u8be2\u65e5\u5fd7\u5c06\u5305\u542b\u4e00\u4e2a \u201cmultiplier\u201d \u5b57\u6bb5\uff0c\u7528\u4e8e\u6307\u5b9a\u4e00\u8d77\u5904\u7406\u4e86\u591a\u5c11\u67e5\u8be2\uff1a\n\n\u8bf7\u6ce8\u610f \u201cx3\u201d \u5b57\u6bb5\u3002\u8fd9\u610f\u5473\u7740\u8be5\u67e5\u8be2\u5df2\u88ab\u4f18\u5316\uff0c\u5e76\u5728\u4e00\u4e2a\u5305\u542b 3 \u4e2a\u67e5\u8be2\u7684\u5b50\u6279\u5904\u7406\u4e2d\u5904\u7406\u3002\n\n\n<!-- intro -->\n##### \u65e5\u5fd7\uff1a\n\n<!-- request log -->\nCODE_BLOCK_2\n<!-- end -->\n\n<!-- example multi-query 3 -->\n\u4f9b\u53c2\u8003\uff0c\u5982\u679c\u672a\u5bf9\u67e5\u8be2\u8fdb\u884c\u6279\u5904\u7406\uff0c\u5e38\u89c4\u65e5\u5fd7\u5c06\u5982\u4e0b\u6240\u793a\uff1a\n\n\n<!-- intro -->\n##### \u65e5\u5fd7\uff1a\n\n<!-- request log -->\nCODE_BLOCK_3\n<!-- end -->\n\n\u6ce8\u610f\uff0c\u591a\u91cd\u67e5\u8be2\u60c5\u51b5\u4e0b\u7684\u6bcf\u67e5\u8be2\u65f6\u95f4\u6839\u636e\u5177\u4f53\u7684\u6392\u5e8f\u6a21\u5f0f\u63d0\u5347\u4e86\u7ea6 1.5 \u500d\u5230 2.3 \u500d\u3002\n\n<!-- proofread -->",
  6. "russian": "# \u041c\u0443\u043b\u044c\u0442\u0438-\u0437\u0430\u043f\u0440\u043e\u0441\u044b\n\n\u041c\u0443\u043b\u044c\u0442\u0438-\u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0438\u043b\u0438 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 Manticore \u0432 \u043e\u0434\u043d\u043e\u043c \u0441\u0435\u0442\u0435\u0432\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435.\n\n\ud83d\udc4d \u0417\u0430\u0447\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0443\u043b\u044c\u0442\u0438-\u0437\u0430\u043f\u0440\u043e\u0441\u044b?\n\n\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u2014 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 Manticore \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438, \u0430 \u043d\u0435 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443, \u0432\u044b \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u0435 \u0432\u0440\u0435\u043c\u044f \u0437\u0430 \u0441\u0447\u0451\u0442 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 Manticore \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u043a \u043f\u0430\u043a\u0435\u0442\u0443 \u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u044b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.\n\n\u26d4 \u041a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0443\u043b\u044c\u0442\u0438-\u0437\u0430\u043f\u0440\u043e\u0441\u044b?\n\n\u041c\u0443\u043b\u044c\u0442\u0438-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0442\u0440\u0435\u0431\u0443\u044e\u0442, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 \u0431\u044b\u043b\u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b, \u0447\u0442\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0442\u0430\u043a. \u0418\u043d\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 B \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 A, \u0442\u043e \u0435\u0441\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 B \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0434\u0430\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 A. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u0442\u044c \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438\u0437 \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u043e\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u044b, \u0438\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0439 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435. \u0412 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b (\u0438\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b).\n\n<!-- example multi-query 1 -->\n\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432 SQL, \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044f \u0438\u0445 \u0442\u043e\u0447\u043a\u043e\u0439 \u0441 \u0437\u0430\u043f\u044f\u0442\u043e\u0439. \u041a\u043e\u0433\u0434\u0430 Manticore \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u0442\u0430\u043a\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435, \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u044b \u0432\u0441\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438.\n\n\u041c\u0443\u043b\u044c\u0442\u0438-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441 `FACET`. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u0443\u043b\u044c\u0442\u0438-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u043e\u0434\u043d\u043e\u043c \u043f\u0430\u043a\u0435\u0442\u0435 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 [max_batch_queries](../Server_settings/Searchd.md#max_batch_queries).\n\n\n<!-- intro -->\n##### SQL:\n\n<!-- request SQL -->\n\nCODE_BLOCK_0\n<!-- end -->\n\n## \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0443\u043b\u044c\u0442\u0438-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\n\n\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0432\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c: \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0449\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0449\u0438\u0445 \u043f\u043e\u0434\u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432.\n\n**\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0449\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432** \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e `searchd` \u0432\u044b\u044f\u0432\u0438\u0442 \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u043f\u0430\u043a\u0435\u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0438 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438, \u0438 *\u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442 \u043f\u043e\u0438\u0441\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437*. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043f\u0430\u043a\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 3 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0432\u0441\u0435 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e \"ipod nano\", \u043d\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u043f-10 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432, \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0446\u0435\u043d\u0435, \u0432\u0442\u043e\u0440\u043e\u0439 \u2014 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u0435\u0442 \u043f\u043e ID \u043f\u0440\u043e\u0434\u0430\u0432\u0446\u0430 \u0438 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u043f-5 \u043f\u0440\u043e\u0434\u0430\u0432\u0446\u043e\u0432, \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0443, \u0430 \u0442\u0440\u0435\u0442\u0438\u0439 \u2014 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0446\u0435\u043d\u0443, \u043f\u043e\u043b\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043f\u043e \"ipod nano\" \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0442\u0440\u0451\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432.\n\n[\u0424\u0430\u0441\u0435\u0442\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a](../Searching/Faceted_search.md) \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432\u044b\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442 \u043e\u0442 \u044d\u0442\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0444\u0430\u0441\u0435\u0442\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432: \u043e\u0434\u0438\u043d \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0430\u043c\u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u043e\u0438\u0441\u043a\u0430 \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u0441 \u0442\u0435\u043c \u0436\u0435 \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c, \u043d\u043e \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u044b\u0445 \u0433\u0440\u0443\u043f\u043f (\u0442\u043e\u043f-3 \u0430\u0432\u0442\u043e\u0440\u043e\u0432, \u0442\u043e\u043f-5 \u043f\u0440\u043e\u0434\u0430\u0432\u0446\u043e\u0432 \u0438 \u0442.\u0434.). \u041f\u043e\u043a\u0430 \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438, \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0449\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.\n\n**\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0449\u0438\u0445 \u043f\u043e\u0434\u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432** \u0435\u0449\u0451 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435. \u041e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 `searchd` \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430 \u043c\u0435\u0436\u0434\u0443 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u043c\u0438 \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438. \u041e\u043d \u0432\u044b\u044f\u0432\u043b\u044f\u0435\u0442 \u043e\u0431\u0449\u0438\u0435 \u0447\u0430\u0441\u0442\u0438 \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 (\u043f\u043e\u0434\u0434\u0435\u0440\u0435\u0432\u044c\u044f) \u0441\u0440\u0435\u0434\u0438 \u0432\u0441\u0435\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043a\u044d\u0448\u0438\u0440\u0443\u0435\u0442 \u0438\u0445 \u043c\u0435\u0436\u0434\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0430\u043a\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432:\n\nCODE_BLOCK_1\n\n\u0415\u0441\u0442\u044c \u043e\u0431\u0449\u0438\u0439 \u0434\u0432\u0443\u0445\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 `donald trump`, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0449\u0438\u0445 \u043f\u043e\u0434\u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432. \u0420\u0430\u0437\u043c\u0435\u0440 \u043a\u044d\u0448\u0430 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u0442\u0440\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430\u043c\u0438 [subtree_docs_cache](../Server_settings/Searchd.md#subtree_docs_cache) \u0438 [subtree_hits_cache](../Server_settings/Searchd.md#subtree_hits_cache) (\u0447\u0442\u043e\u0431\u044b \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 *\u0432\u0441\u0435\u0445* 16 \u043c\u0438\u043b\u043b\u0438\u0430\u0440\u0434\u043e\u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0445 \u0441 \"i am\", \u043d\u0435 \u0438\u0441\u0447\u0435\u0440\u043f\u0430\u043b\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u043d\u0435 \u0443\u0431\u0438\u043b\u043e \u0441\u0435\u0440\u0432\u0435\u0440 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e).\n\n<!-- example multi-query 2 -->\n\u041a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u043b\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b? \u0415\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u043b\u043e\u0433\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043b\u0435 \"multiplier\", \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0431\u044b\u043b\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043e \u0432\u043c\u0435\u0441\u0442\u0435:\n\n\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u043e\u043b\u0435 \"x3\". \u041e\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0431\u044b\u043b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0432 \u043f\u043e\u0434-\u043f\u0430\u043a\u0435\u0442\u0435 \u0438\u0437 3 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.\n\n\n<!-- intro -->\n##### \u043b\u043e\u0433:\n\n<!-- request log -->\nCODE_BLOCK_2\n<!-- end -->\n\n<!-- example multi-query 3 -->\n\u0414\u043b\u044f \u0441\u043f\u0440\u0430\u0432\u043a\u0438, \u0432\u043e\u0442 \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u0431\u044b \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043b\u043e\u0433, \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0435 \u0431\u044b\u043b\u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u044b \u0432 \u043f\u0430\u043a\u0435\u0442:\n\n\n<!-- intro -->\n##### \u043b\u043e\u0433:\n\n<!-- request log -->\nCODE_BLOCK_3\n<!-- end -->\n\n\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u0443\u043b\u044c\u0442\u0438-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0443\u043b\u0443\u0447\u0448\u0438\u043b\u043e\u0441\u044c \u0432 1.5 \u2013 2.3 \u0440\u0430\u0437\u0430, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0440\u0435\u0436\u0438\u043c\u0430 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438.\n\n<!-- proofread -->\n\n"
  7. },
  8. "is_code_or_comment": false,
  9. "model": "openai:gpt-4.1-mini",
  10. "updated_at": 1766340921
  11. },
  12. "1ff6d625db1129e9542b804fb73959bf027973ab9c1c771b2a90d121befa9439": {
  13. "original": "# Multi-queries\n\nMulti-queries, or query batches, allow you to send multiple search queries to Manticore in a single network request.\n\n\ud83d\udc4d Why use multi-queries?\n\nThe primary reason is performance. By sending requests to Manticore in a batch instead of one by one, you save time by reducing network round-trips. Additionally, sending queries in a batch allows Manticore to perform certain internal optimizations. If no batch optimizations can be applied, queries will be processed individually.\n\n\u26d4 When not to use multi-queries?\n\nMulti-queries require all search queries in a batch to be independent, which isn't always the case. Sometimes query B depends on query A's results, meaning query B can only be set up after executing query A. For example, you might want to display results from a secondary index only if no results were found in the primary table, or you may want to specify an offset into the 2nd result set based on the number of matches in the 1st result set. In these cases, you'll need to use separate queries (or separate batches).\n\n<!-- example multi-query 1 -->\nYou can run multiple search queries with SQL by separating them with a semicolon. When Manticore receives a query formatted like this from a client, all inter-statement optimizations will be applied.\n\nMulti-queries don't support queries with `FACET`. The number of multi-queries in one batch shouldn't exceed [max_batch_queries](../Server_settings/Searchd.md#max_batch_queries).\n\n<!-- intro -->\n##### SQL:\n\n<!-- request SQL -->\n\nCODE_BLOCK_0\n<!-- end -->\n\n## Multi-queries optimizations\n\nThere are two major optimizations to be aware of: common query optimization and common subtree optimization.\n\n**Common query optimization** means that `searchd` will identify all those queries in a batch where only the sorting and group-by settings differ, and *only perform searching once*. For example, if a batch consists of 3 queries, all of them are for \"ipod nano\", but the 1st query requests the top-10 results sorted by price, the 2nd query groups by vendor ID and requests the top-5 vendors sorted by rating, and the 3rd query requests the max price, full-text search for \"ipod nano\" will only be performed once, and its results will be reused to build 3 different result sets.\n\n[Faceted search](../Searching/Faceted_search.md) is a particularly important case that benefits from this optimization. Indeed, faceted searching can be implemented by running several queries, one to retrieve search results themselves, and a few others with the same full-text query but different group-by settings to retrieve all the required groups of results (top-3 authors, top-5 vendors, etc). As long as the full-text query and filtering settings stay the same, common query optimization will trigger, and greatly improve performance.\n\n**Common subtree optimization** is even more interesting. It allows `searchd` to exploit similarities between batched full-text queries. It identifies common full-text query parts (subtrees) in all queries and caches them between queries. For example, consider the following query batch:\n\nCODE_BLOCK_1\n\nThere's a common two-word part `donald trump` that can be computed only once, then cached and shared across the queries. And common subtree optimization does just that. Per-query cache size is strictly controlled by [subtree_docs_cache](../Server_settings/Searchd.md#subtree_docs_cache) and [subtree_hits_cache](../Server_settings/Searchd.md#subtree_hits_cache) directives (so that caching *all* sixteen gazillions of documents that match \"i am\" does not exhaust the RAM and instantly kill your server).\n\n<!-- example multi-query 2 -->\nHow can you tell if the queries in the batch were actually optimized? If they were, the respective query log will have a \"multiplier\" field that specifies how many queries were processed together:\n\nNote the \"x3\" field. It means that this query was optimized and processed in a sub-batch of 3 queries.\n\n<!-- intro -->\n##### log:\n\n<!-- request log -->\nCODE_BLOCK_2\n<!-- end -->\n\n<!-- example multi-query 3 -->\nFor reference, this is how the regular log would look like if the queries were not batched:\n\n<!-- intro -->\n##### log:\n\n<!-- request log -->\nCODE_BLOCK_3\n<!-- end -->\n\nNotice how the per-query time in the multi-query case improved by a factor of 1.5x to 2.3x, depending on the specific sorting mode.\n\n<!-- proofread -->\n\n",
  14. "translations": {
  15. "chinese": "# \u591a\u67e5\u8be2\n\n\u591a\u67e5\u8be2\uff0c\u6216\u67e5\u8be2\u6279\u5904\u7406\uff0c\u5141\u8bb8\u60a8\u5728\u4e00\u4e2a\u7f51\u7edc\u8bf7\u6c42\u4e2d\u5411 Manticore \u53d1\u9001\u591a\u4e2a\u641c\u7d22\u67e5\u8be2\u3002\n\n\ud83d\udc4d \u4e3a\u4ec0\u4e48\u4f7f\u7528\u591a\u67e5\u8be2\uff1f\n\n\u4e3b\u8981\u539f\u56e0\u5728\u4e8e\u6027\u80fd\u3002\u901a\u8fc7\u5c06\u8bf7\u6c42\u4ee5\u6279\u5904\u7406\u7684\u5f62\u5f0f\u53d1\u9001\u5230 Manticore \u800c\u4e0d\u662f\u9010\u4e2a\u53d1\u9001\uff0c\u53ef\u4ee5\u8282\u7701\u65f6\u95f4\u5e76\u51cf\u5c11\u7f51\u7edc\u5f80\u8fd4\u6b21\u6570\u3002\u6b64\u5916\uff0c\u4ee5\u6279\u5904\u7406\u5f62\u5f0f\u53d1\u9001\u67e5\u8be2\u53ef\u4ee5\u8ba9 Manticore \u6267\u884c\u67d0\u4e9b\u5185\u90e8\u4f18\u5316\u3002\u5982\u679c\u65e0\u6cd5\u5e94\u7528\u6279\u5904\u7406\u4f18\u5316\uff0c\u5219\u67e5\u8be2\u5c06\u5355\u72ec\u5904\u7406\u3002\n\n\u26d4 \u4f55\u65f6\u4e0d\u4f7f\u7528\u591a\u67e5\u8be2\uff1f\n\n\u591a\u67e5\u8be2\u8981\u6c42\u6279\u5904\u7406\u4e2d\u7684\u6240\u6709\u641c\u7d22\u67e5\u8be2\u90fd\u662f\u72ec\u7acb\u7684\uff0c\u8fd9\u5e76\u4e0d\u603b\u662f\u53ef\u884c\u7684\u3002\u6709\u65f6\u67e5\u8be2 B \u4f9d\u8d56\u4e8e\u67e5\u8be2 A \u7684\u7ed3\u679c\uff0c\u8fd9\u610f\u5473\u7740\u67e5\u8be2 B \u53ea\u80fd\u5728\u6267\u884c\u67e5\u8be2 A \u4e4b\u540e\u624d\u80fd\u8bbe\u7f6e\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u80fd\u53ea\u60f3\u5728\u4e3b\u8868\u4e2d\u672a\u627e\u5230\u7ed3\u679c\u65f6\u663e\u793a\u6b21\u7ea7\u7d22\u5f15\u7684\u7ed3\u679c\uff0c\u6216\u8005\u53ef\u80fd\u9700\u8981\u6839\u636e\u7b2c\u4e00\u4e2a\u7ed3\u679c\u96c6\u4e2d\u7684\u5339\u914d\u6570\u91cf\u6307\u5b9a\u7b2c\u4e8c\u4e2a\u7ed3\u679c\u96c6\u4e2d\u7684\u504f\u79fb\u91cf\u3002\u5728\u8fd9\u4e9b\u60c5\u51b5\u4e0b\uff0c\u60a8\u5c06\u9700\u8981\u4f7f\u7528\u5355\u72ec\u7684\u67e5\u8be2\uff08\u6216\u5355\u72ec\u7684\u6279\u5904\u7406\uff09\u3002\n\n<!-- \u793a\u4f8b\u591a\u67e5\u8be2 1 -->\n\u60a8\u53ef\u4ee5\u4f7f\u7528\u5206\u53f7\u5206\u9694\u591a\u4e2a SQL \u67e5\u8be2\u6765\u8fd0\u884c\u591a\u4e2a\u641c\u7d22\u67e5\u8be2\u3002\u5f53 Manticore \u4ece\u5ba2\u6237\u7aef\u63a5\u6536\u5230\u8fd9\u79cd\u683c\u5f0f\u7684\u67e5\u8be2\u65f6\uff0c\u6240\u6709\u8bed\u53e5\u95f4\u7684\u4f18\u5316\u90fd\u5c06\u88ab\u5e94\u7528\u3002\n\n\u591a\u67e5\u8be2\u4e0d\u652f\u6301\u5e26\u6709 `FACET` \u7684\u67e5\u8be2\u3002\u4e00\u4e2a\u6279\u5904\u7406\u4e2d\u7684\u591a\u67e5\u8be2\u6570\u91cf\u4e0d\u5e94\u8d85\u8fc7 [max_batch_queries](../Server_settings/Searchd.md#max_batch_queries)\u3002\n\n<!-- \u5f15\u5165 -->\n##### SQL\uff1a\n\n<!-- \u8bf7\u6c42 SQL -->\n\nCODE_BLOCK_0\n<!-- \u7ed3\u675f -->\n\n## \u591a\u67e5\u8be2\u4f18\u5316\n\n\u6709\u4e24\u79cd\u4e3b\u8981\u7684\u4f18\u5316\u9700\u8981\u4e86\u89e3\uff1a\u516c\u5171\u67e5\u8be2\u4f18\u5316\u548c\u516c\u5171\u5b50\u6811\u4f18\u5316\u3002\n\n**\u516c\u5171\u67e5\u8be2\u4f18\u5316**\u610f\u5473\u7740 `searchd` \u5c06\u8bc6\u522b\u51fa\u6279\u5904\u7406\u4e2d\u6240\u6709\u4ec5\u6392\u5e8f\u548c\u5206\u7ec4\u8bbe\u7f6e\u4e0d\u540c\u7684\u67e5\u8be2\uff0c\u5e76\u4e14 *\u53ea\u6267\u884c\u4e00\u6b21\u641c\u7d22*\u3002\u4f8b\u5982\uff0c\u5982\u679c\u6279\u5904\u7406\u5305\u542b 3 \u4e2a\u67e5\u8be2\uff0c\u6240\u6709\u67e5\u8be2\u90fd\u662f\u9488\u5bf9 \"ipod nano\" \u7684\uff0c\u4f46\u7b2c\u4e00\u4e2a\u67e5\u8be2\u8bf7\u6c42\u6309\u4ef7\u683c\u6392\u5e8f\u7684\u524d 10 \u4e2a\u7ed3\u679c\uff0c\u7b2c\u4e8c\u4e2a\u67e5\u8be2\u6309\u4f9b\u5e94\u5546 ID \u5206\u7ec4\u5e76\u8bf7\u6c42\u6309\u8bc4\u5206\u6392\u5e8f\u7684\u524d 5 \u4e2a\u4f9b\u5e94\u5546\uff0c\u7b2c\u4e09\u4e2a\u67e5\u8be2\u8bf7\u6c42\u6700\u9ad8\u4ef7\u683c\uff0c\u90a3\u4e48\u5bf9 \"ipod nano\" \u7684\u5168\u6587\u641c\u7d22\u5c06\u53ea\u6267\u884c\u4e00\u6b21\uff0c\u5e76\u4e14\u5176\u7ed3\u679c\u5c06\u88ab\u91cd\u7528\u4ee5\u6784\u5efa 3 \u4e2a\u4e0d\u540c\u7684\u7ed3\u679c\u96c6\u3002\n\n[\u5206\u9762\u641c\u7d22](../Searching/Faceted_search.md) \u662f\u7279\u522b\u91cd\u8981\u7684\u4e00\u79cd\u60c5\u51b5\uff0c\u53ef\u4ee5\u4ece\u8fd9\u79cd\u4f18\u5316\u4e2d\u53d7\u76ca\u3002\u786e\u5b9e\uff0c\u5206\u9762\u641c\u7d22\u53ef\u4ee5\u901a\u8fc7\u8fd0\u884c\u51e0\u4e2a\u67e5\u8be2\u6765\u5b9e\u73b0\uff0c\u4e00\u4e2a\u67e5\u8be2\u7528\u4e8e\u68c0\u7d22\u641c\u7d22\u7ed3\u679c\u672c\u8eab\uff0c\u800c\u5176\u4ed6\u51e0\u4e2a\u67e5\u8be2\u4f7f\u7528\u76f8\u540c\u7684\u5168\u6587\u67e5\u8be2\u4f46\u4e0d\u540c\u7684\u5206\u7ec4\u8bbe\u7f6e\u6765\u68c0\u7d22\u6240\u6709\u6240\u9700\u7684\u5206\u7ec4\u7ed3\u679c\uff08\u524d 3 \u4f4d\u4f5c\u8005\uff0c\u524d 5 \u4f4d\u4f9b\u5e94\u5546\u7b49\uff09\u3002\u53ea\u8981\u5168\u6587\u67e5\u8be2\u548c\u8fc7\u6ee4\u8bbe\u7f6e\u4fdd\u6301\u4e0d\u53d8\uff0c\u516c\u5171\u67e5\u8be2\u4f18\u5316\u5c31\u4f1a\u89e6\u53d1\uff0c\u5e76\u663e\u8457\u63d0\u9ad8\u6027\u80fd\u3002\n\n**\u516c\u5171\u5b50\u6811\u4f18\u5316**\u66f4\u52a0\u6709\u8da3\u3002\u5b83\u5141\u8bb8 `searchd` \u5229\u7528\u6279\u5904\u7406\u4e2d\u7684\u5168\u6587\u67e5\u8be2\u4e4b\u95f4\u7684\u76f8\u4f3c\u6027\u3002\u5b83\u4f1a\u8bc6\u522b\u51fa\u6240\u6709\u67e5\u8be2\u4e2d\u7684\u516c\u5171\u5168\u6587\u67e5\u8be2\u90e8\u5206\uff08\u5b50\u6811\uff09\uff0c\u5e76\u5728\u67e5\u8be2\u4e4b\u95f4\u7f13\u5b58\u5b83\u4eec\u3002\u4f8b\u5982\uff0c\u8003\u8651\u4ee5\u4e0b\u67e5\u8be2\u6279\u5904\u7406\uff1a\n\nCODE_BLOCK_1\n\n\u6709\u4e00\u4e2a\u4e24\u4e2a\u8bcd\u7684\u90e8\u5206 `donald trump`\uff0c\u8fd9\u4e2a\u90e8\u5206\u53ea\u9700\u8981\u8ba1\u7b97\u4e00\u6b21\uff0c\u7136\u540e\u7f13\u5b58\u5e76\u5171\u4eab\u7ed9\u6240\u6709\u67e5\u8be2\u3002\u516c\u5171\u5b50\u6811\u4f18\u5316\u6b63\u662f\u8fd9\u6837\u505a\u7684\u3002\u6bcf\u4e2a\u67e5\u8be2\u7684\u7f13\u5b58\u5927\u5c0f\u7531 [subtree_docs_cache](../Server_settings/Searchd.md#subtree_docs_cache) \u548c [subtree_hits_cache](../Server_settings/Searchd.md#subtree_hits_cache) \u6307\u4ee4\u4e25\u683c\u63a7\u5236\uff08\u4ee5\u786e\u4fdd\u7f13\u5b58\u6240\u6709 160 \u4ebf\u4e2a\u5339\u914d \"i am\" \u7684\u6587\u6863\u4e0d\u4f1a\u8017\u5c3d\u5185\u5b58\u5e76\u7acb\u5373\u6740\u6b7b\u670d\u52a1\u5668\uff09\u3002\n\n<!-- \u793a\u4f8b\u591a\u67e5\u8be2 2 -->\n\u5982\u4f55\u77e5\u9053\u6279\u5904\u7406\u4e2d\u7684\u67e5\u8be2\u662f\u5426\u5b9e\u9645\u8fdb\u884c\u4e86\u4f18\u5316\uff1f\u5982\u679c\u8fdb\u884c\u4e86\u4f18\u5316\uff0c\u76f8\u5e94\u7684\u67e5\u8be2\u65e5\u5fd7\u5c06\u6709\u4e00\u4e2a \"multiplier\" \u5b57\u6bb5\uff0c\u6307\u660e\u6709\u591a\u5c11\u4e2a\u67e5\u8be2\u88ab\u4e00\u8d77\u5904\u7406\uff1a\n\n\u6ce8\u610f \"x3\" \u5b57\u6bb5\u3002\u8fd9\u610f\u5473\u7740\u6b64\u67e5\u8be2\u88ab\u4f18\u5316\u5e76\u88ab\u5904\u7406\u5728\u4e00\u4e2a\u5b50\u6279\u5904\u7406\u4e2d\u7684 3 \u4e2a\u67e5\u8be2\u3002\n\n<!-- \u5f15\u5165 -->\n##### \u65e5\u5fd7\uff1a\n\n<!-- \u8bf7\u6c42\u65e5\u5fd7 -->\nCODE_BLOCK_2\n<!-- \u7ed3\u675f -->\n\n<!-- \u793a\u4f8b\u591a\u67e5\u8be2 3 -->\n\u4f5c\u4e3a\u53c2\u8003\uff0c\u5982\u679c\u67e5\u8be2\u672a\u88ab\u6279\u5904\u7406\uff0c\u5e38\u89c4\u65e5\u5fd7\u5c06\u5982\u4e0b\u6240\u793a\uff1a\n\n<!-- \u5f15\u5165 -->\n##### \u65e5\u5fd7\uff1a\n\n<!-- \u8bf7\u6c42\u65e5\u5fd7 -->\nCODE_BLOCK_3\n<!-- \u7ed3\u675f -->\n\n\u6ce8\u610f\uff0c\u5728\u591a\u67e5\u8be2\u60c5\u51b5\u4e0b\uff0c\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u63d0\u9ad8\u4e86 1.5 \u5230 2.3 \u500d\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u7279\u5b9a\u7684\u6392\u5e8f\u6a21\u5f0f\u3002\n\n<!-- \u6821\u5bf9 -->",
  16. "russian": "# \u041c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441\u044b\n\n\u041c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0438\u043b\u0438 \u043f\u0430\u043a\u0435\u0442\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 Manticore \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430.\n\n\ud83d\udc4d \u0417\u0430\u0447\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441\u044b?\n\n\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u2014 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 Manticore \u043f\u0430\u043a\u0435\u0442\u043e\u043c, \u0430 \u043d\u0435 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443, \u0432\u044b \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u0435 \u0432\u0440\u0435\u043c\u044f \u0437\u0430 \u0441\u0447\u0435\u0442 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043e\u0431\u0445\u043e\u0434\u043e\u0432. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u0430\u043a\u0435\u0442\u043e\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 Manticore \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0430\u043a\u0435\u0442\u0430 \u043d\u0435\u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u044b, \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043d\u0434\u0438\u0432\u0438\u0434\u0443\u0430\u043b\u044c\u043d\u043e.\n\n\u26d4 \u041a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441\u044b?\n\n\u041c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0442\u0440\u0435\u0431\u0443\u044e\u0442, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 \u0431\u044b\u043b\u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c\u0438, \u0447\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430. \u0418\u043d\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 B \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 A, \u0442\u043e \u0435\u0441\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 B \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 A. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u0442\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438\u0437 \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u043e\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432, \u0438\u043b\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0439 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432. \u0412 \u044d\u0442\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b (\u0438\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b).\n\n<!-- example multi-query 1 -->\n\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e SQL, \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044f \u0438\u0445 \u0442\u043e\u0447\u043a\u043e\u0439 \u0441 \u0437\u0430\u043f\u044f\u0442\u043e\u0439. \u041a\u043e\u0433\u0434\u0430 Manticore \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0437\u0430\u043f\u0440\u043e\u0441, \u043e\u0442\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u044b \u0432\u0441\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438.\n\n\u041c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441 `FACET`. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u043e\u0434\u043d\u043e\u043c \u043f\u0430\u043a\u0435\u0442\u0435 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0442\u044c [max_batch_queries](../Server_settings/Searchd.md#max_batch_queries).\n\n<!-- intro -->\n##### SQL:\n\n<!-- request SQL -->\n\nCODE_BLOCK_0\n<!-- end -->\n\n## \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\n\n\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0432\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u043d\u0430\u0442\u044c: \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0449\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0449\u0435\u0433\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0435\u0432\u0430.\n\n**\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0449\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430** \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e `searchd` \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442 \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u043f\u0430\u043a\u0435\u0442\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0438 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438, \u0438 *\u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442 \u043f\u043e\u0438\u0441\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437*. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043f\u0430\u043a\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 3 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0432\u0441\u0435 \u043e\u043d\u0438 \u0434\u043b\u044f \"ipod nano\", \u043d\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u043f-10 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432, \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0446\u0435\u043d\u0435, \u0432\u0442\u043e\u0440\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u0435\u0442 \u043f\u043e ID \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u0430 \u0438 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u043f-5 \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u043e\u0432, \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0443, \u0430 \u0442\u0440\u0435\u0442\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0446\u0435\u043d\u0443, \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043f\u043e \"ipod nano\" \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u0438 \u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f 3 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432.\n\n[\u0424\u0430\u0441\u0435\u0442\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a](../Searching/Faceted_search.md) \u2014 \u044d\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432\u0430\u0436\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442 \u043e\u0442 \u044d\u0442\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0444\u0430\u0441\u0435\u0442\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432: \u043e\u0434\u0438\u043d \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0430\u043c\u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u043e\u0438\u0441\u043a\u0430, \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u0441 \u0442\u0435\u043c \u0436\u0435 \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c, \u043d\u043e \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0445 \u0433\u0440\u0443\u043f\u043f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 (\u0442\u043e\u043f-3 \u0430\u0432\u0442\u043e\u0440\u0430, \u0442\u043e\u043f-5 \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u043e\u0432 \u0438 \u0442.\u0434.). \u041f\u043e\u043a\u0430 \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u044b\u043c\u0438, \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0449\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0432\u044b\u0441\u0438\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.\n\n**\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0449\u0435\u0433\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0435\u0432\u0430** \u0435\u0449\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435. \u041e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 `searchd` \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430 \u043c\u0435\u0436\u0434\u0443 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u043c\u0438 \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438. \u041e\u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043e\u0431\u0449\u0438\u0435 \u0447\u0430\u0441\u0442\u0438 \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 (\u043f\u043e\u0434\u0434\u0435\u0440\u0435\u0432\u044c\u044f) \u0432\u043e \u0432\u0441\u0435\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445 \u0438 \u043a\u044d\u0448\u0438\u0440\u0443\u0435\u0442 \u0438\u0445 \u043c\u0435\u0436\u0434\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0430\u043a\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432:\n\nCODE_BLOCK_1\n\n\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0431\u0449\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0438\u0437 \u0434\u0432\u0443\u0445 \u0441\u043b\u043e\u0432 `donald trump`, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u043c\u0435\u0436\u0434\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0449\u0435\u0433\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0435\u0432\u0430. \u0420\u0430\u0437\u043c\u0435\u0440 \u043a\u044d\u0448\u0430 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441\u0442\u0440\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430\u043c\u0438 [subtree_docs_cache](../Server_settings/Searchd.md#subtree_docs_cache) \u0438 [subtree_hits_cache](../Server_settings/Searchd.md#subtree_hits_cache) (\u0447\u0442\u043e\u0431\u044b \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 *\u0432\u0441\u0435\u0445* \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0438 \u043c\u0438\u043b\u043b\u0438\u0430\u0440\u0434\u043e\u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \"i am\", \u043d\u0435 \u0438\u0441\u0447\u0435\u0440\u043f\u0430\u043b\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u043d\u0435 \u0443\u0431\u0438\u043b\u043e \u0432\u0430\u0448 \u0441\u0435\u0440\u0432\u0435\u0440).\n\n<!-- example multi-query 2 -->\n\u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0431\u044b\u043b\u0438 \u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b? \u0415\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u043b\u043e\u0433\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435 \"multiplier\", \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u0435, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0431\u044b\u043b\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043e \u0432\u043c\u0435\u0441\u0442\u0435:\n\n\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u043e\u043b\u0435 \"x3\". \u041e\u043d\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0431\u044b\u043b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0432 \u043f\u043e\u0434\u043f\u0430\u043a\u0435\u0442\u0435 \u0438\u0437 3 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.\n\n<!-- intro -->\n##### log:\n\n<!-- request log -->\nCODE_BLOCK_2\n<!-- end -->\n\n<!-- example multi-query 3 -->\n\u0414\u043b\u044f \u0441\u043f\u0440\u0430\u0432\u043a\u0438, \u0432\u043e\u0442 \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043b\u043e\u0433, \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0435 \u0431\u044b\u043b\u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u044b \u0432 \u043f\u0430\u043a\u0435\u0442:\n\n<!-- intro -->\n##### log:\n\n<!-- request log -->\nCODE_BLOCK_3\n<!-- end -->\n\n\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043a\u0430\u043a \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0443\u043b\u0443\u0447\u0448\u0438\u043b\u043e\u0441\u044c \u0432 1,5\u20132,3 \u0440\u0430\u0437\u0430 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0440\u0435\u0436\u0438\u043c\u0430 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438.\n\n<!-- proofread -->"
  17. },
  18. "is_code_or_comment": false,
  19. "model": "deepseek/deepseek-v3.2",
  20. "updated_at": 1766374202
  21. },
  22. "2aac3045c626512889ad44a43e9e7930b45bf8e2f0cf03d5443bc9578273219d": {
  23. "original": "You can use `SHOW` for processing *warnings*, *status*, *agent status*, *meta*, *profile*, and *plan*. All other `SHOW` statements in batches will be silently ignored with no output. For example, you cannot execute `SHOW TABLES`, `SHOW THREADS`, or `SHOW VARIABLES`, or any other statement not mentioned above, when batching.\n\nYou can use `SET` only for `SET PROFILING`. All other `SET ...` commands will be silently ignored.\n\nThe order of execution is also different. The daemon processes batches in two passes.\n\nFirst, it collects all `SELECT` statements and runs all `SET PROFILING` statements it sees simultaneously. As a side effect, only the last `SET PROFILING` statement is effective. If you execute a multi-query like this: `SET PROFILING=1; SELECT...; SHOW META; SHOW PROFILE; SET PROFILING=0`, you will not see any profile, because on the first pass, the daemon executes `SET PROFILING=1` and then immediately `SET PROFILING=0`.\n\nSecond, the daemon attempts to execute a single batch query with all collected `SELECT` statements. If statements are not related, it will execute them one-by-one.\n\nFinally, it iterates over the initial batch sequence and returns the sub-result data and meta from the resultset for\neach `SELECT` and `SHOW`. Since all `SET PROFILING` statements were executed in the first pass, they are skipped on this second pass.",
  24. "translations": {
  25. "chinese": "\u4f60\u53ef\u4ee5\u4f7f\u7528 `SHOW` \u6765\u5904\u7406 *\u8b66\u544a*, *\u72b6\u6001*, *\u4ee3\u7406\u72b6\u6001*, *\u5143\u6570\u636e*, *\u914d\u7f6e\u6587\u4ef6* \u548c *\u8ba1\u5212*\u3002\u6240\u6709\u5176\u4ed6\u5728\u6279\u6b21\u4e2d\u7684 `SHOW` \u8bed\u53e5\u5c06\u88ab\u9759\u9ed8\u5ffd\u7565\uff0c\u6ca1\u6709\u4efb\u4f55\u8f93\u51fa\u3002\u4f8b\u5982\uff0c\u4f60\u4e0d\u80fd\u6267\u884c `SHOW TABLES`, `SHOW THREADS`, \u6216 `SHOW VARIABLES`\uff0c\u6216\u4efb\u4f55\u5176\u4ed6\u672a\u63d0\u53ca\u7684\u8bed\u53e5\u8fdb\u884c\u6279\u6b21\u5904\u7406\u3002\n\n\u4f60\u53ef\u4ee5\u4ec5\u4f7f\u7528 `SET` \u6765\u8bbe\u7f6e `SET PROFILING`\u3002\u6240\u6709\u5176\u4ed6 `SET ...` \u547d\u4ee4\u5c06\u88ab\u9759\u9ed8\u5ffd\u7565\u3002\n\n\u6267\u884c\u7684\u987a\u5e8f\u4e5f\u4e0d\u540c\u3002\u5b88\u62a4\u8fdb\u7a0b\u5728\u4e24\u8f6e\u4e2d\u5904\u7406\u6279\u6b21\u3002\n\n\u9996\u5148\uff0c\u5b83\u6536\u96c6\u6240\u6709 `SELECT` \u8bed\u53e5\uff0c\u5e76\u540c\u65f6\u8fd0\u884c\u5b83\u770b\u5230\u7684\u6240\u6709 `SET PROFILING` \u8bed\u53e5\u3002\u4f5c\u4e3a\u526f\u4f5c\u7528\uff0c\u53ea\u6709\u6700\u540e\u4e00\u4e2a `SET PROFILING` \u8bed\u53e5\u6709\u6548\u3002\u5982\u679c\u4f60\u6267\u884c\u4e00\u4e2a\u7c7b\u4f3c\u7684\u591a\u67e5\u8be2\u8bed\u53e5\uff0c\u5982 `SET PROFILING=1; SELECT...; SHOW META; SHOW PROFILE; SET PROFILING=0`\uff0c\u4f60\u5c06\u770b\u4e0d\u5230\u4efb\u4f55\u914d\u7f6e\u6587\u4ef6\uff0c\u56e0\u4e3a\u5728\u7b2c\u4e00\u8f6e\u4e2d\uff0c\u5b88\u62a4\u8fdb\u7a0b\u6267\u884c\u4e86 `SET PROFILING=1`\uff0c\u7136\u540e\u7acb\u5373\u6267\u884c\u4e86 `SET PROFILING=0`\u3002\n\n\u7b2c\u4e8c\u8f6e\uff0c\u5b88\u62a4\u8fdb\u7a0b\u5c1d\u8bd5\u4f7f\u7528\u6536\u96c6\u7684\u6240\u6709 `SELECT` \u8bed\u53e5\u6267\u884c\u5355\u4e2a\u6279\u6b21\u67e5\u8be2\u3002\u5982\u679c\u8bed\u53e5\u4e0d\u76f8\u5173\uff0c\u5b83\u5c06\u4f9d\u6b21\u6267\u884c\u5b83\u4eec\u3002\n\n\u6700\u540e\uff0c\u5b83\u904d\u5386\u521d\u59cb\u6279\u6b21\u5e8f\u5217\uff0c\u5e76\u8fd4\u56de\u7ed3\u679c\u96c6\u4e2d\u7684\u6bcf\u4e2a `SELECT` \u548c `SHOW` \u7684\u5b50\u7ed3\u679c\u6570\u636e\u548c\u5143\u6570\u636e\u3002\u7531\u4e8e\u6240\u6709 `SET PROFILING` \u8bed\u53e5\u5728\u7b2c\u4e00\u8f6e\u4e2d\u5df2\u6267\u884c\uff0c\u56e0\u6b64\u5728\u7b2c\u4e8c\u8f6e\u4e2d\u5c06\u88ab\u8df3\u8fc7\u3002",
  26. "russian": "\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c `SHOW` \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 *\u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439*, *\u0441\u0442\u0430\u0442\u0443\u0441\u0430*, *\u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u0430\u0433\u0435\u043d\u0442\u0430*, *\u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445*, *\u043f\u0440\u043e\u0444\u0438\u043b\u044f* \u0438 *\u043f\u043b\u0430\u043d\u0430*. \u0412\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b `SHOW` \u0432 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 \u0431\u0443\u0434\u0443\u0442 \u0442\u0438\u0445\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0435\u0437 \u0432\u044b\u0432\u043e\u0434\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c `SHOW TABLES`, `SHOW THREADS` \u0438\u043b\u0438 `SHOW VARIABLES`, \u0438\u043b\u0438 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440, \u043d\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0439 \u0432\u044b\u0448\u0435, \u043f\u0440\u0438 \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435.\n\n\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c `SET` \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f `SET PROFILING`. \u0412\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b `SET ...` \u0431\u0443\u0434\u0443\u0442 \u0442\u0438\u0445\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f.\n\n\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f. \u0414\u0435\u043c\u043e\u043d \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u0430\u043a\u0435\u0442\u044b \u0432 \u0434\u0432\u0430 \u043f\u0440\u043e\u0445\u043e\u0434\u0430.\n\n\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043d \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0441\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b `SELECT` \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0432\u0441\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b `SET PROFILING` \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u041a\u0430\u043a \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442, \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 `SET PROFILING` \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c. \u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: `SET PROFILING=1; SELECT...; SHOW META; SHOW PROFILE; SET PROFILING=0`, \u0432\u044b \u043d\u0435 \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0444\u0438\u043b\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0440\u043e\u0445\u043e\u0434\u0435 \u0434\u0435\u043c\u043e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 `SET PROFILING=1`, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u0440\u0430\u0437\u0443 `SET PROFILING=0`.\n\n\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0434\u0435\u043c\u043e\u043d \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438 `SELECT`. \u0415\u0441\u043b\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u044b, \u043e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442 \u0438\u0445 \u043e\u0434\u0438\u043d \u0437\u0430 \u0434\u0440\u0443\u0433\u0438\u043c.\n\n\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043e\u043d \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0430\u043a\u0435\u0442\u0430 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0434\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0438 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e `SELECT` \u0438 `SHOW`. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0441\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b `SET PROFILING` \u0431\u044b\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0440\u043e\u0445\u043e\u0434\u0435, \u043e\u043d\u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u044d\u0442\u043e\u043c \u0432\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u0445\u043e\u0434\u0435."
  27. },
  28. "is_code_or_comment": false,
  29. "model": "deepseek/deepseek-v3.2",
  30. "updated_at": 1766382872
  31. },
  32. "df34286a37d406b9edab25025e070f7dfd7709c60d950087be663bb73b414163": {
  33. "original": "# Multi-queries\n\nMulti-queries, or query batches, allow you to send multiple search queries to Manticore in a single network request.\n\n\ud83d\udc4d Why use multi-queries?\n\nThe primary reason is performance. By sending requests to Manticore in a batch instead of one by one, you save time by reducing network round-trips. Additionally, sending queries in a batch allows Manticore to perform certain internal optimizations. If no batch optimizations can be applied, queries will be processed individually.\n\n\u26d4 When not to use multi-queries?\n\nMulti-queries require all search queries in a batch to be independent, which isn't always the case. Sometimes query B depends on query A's results, meaning query B can only be set up after executing query A. For example, you might want to display results from a secondary index only if no results were found in the primary table, or you may want to specify an offset into the 2nd result set based on the number of matches in the 1st result set. In these cases, you'll need to use separate queries (or separate batches).\n\nWhen using connector libraries, such as `mysqli` in PHP, you can add multiple queries and then run them all as a single batch. This will work as a single multi-query batch.\n\nNote: If you use a console MySQL client, by default it interprets the semicolon (;) as the delimiter itself, and sends each query to the server individually; this is not a multi-query batch. To override this behavior, redefine the separator on the client-side to another character using the internal command `delimiter`. After making this change, the client will send the entire string with semicolons unchanged, allowing the \"multi-query magic\" to work.\n\nThis aside behavior of the console client can often be confusing because you might notice that one and the same sequence of commands behaves differently in the MySQL client console compared to another protocol like SQL-over-HTTP. This is exactly because the MySQL console client itself divides queries using semicolons, but other protocols may send an entire sequence as a single batch.\n\n<!-- example multi-query 1 -->\nYou can run multiple search queries with SQL by separating them with a semicolon. When Manticore receives a query formatted like this from a client, all inter-statement optimizations will be applied.\n\nMulti-queries don't support queries with `FACET`. The number of multi-queries in one batch shouldn't exceed [max_batch_queries](../Server_settings/Searchd.md#max_batch_queries).\n\n<!-- intro -->\n##### SQL:\n\n<!-- request SQL -->\n\nCODE_BLOCK_0\n<!-- end -->\n\nFrom a console MySQL/MariaDB client:\n<!-- request SQL -->\n\nCODE_BLOCK_1\n<!-- end -->\n\n## Multi-queries optimizations\n\nThere are two major optimizations to be aware of: common query optimization and common subtree optimization.\n\n**Common query optimization** means that `searchd` will identify all those queries in a batch where only the sorting and group-by settings differ, and *only perform searching once*. For example, if a batch consists of 3 queries, all of them are for \"ipod nano\", but the 1st query requests the top-10 results sorted by price, the 2nd query groups by vendor ID and requests the top-5 vendors sorted by rating, and the 3rd query requests the max price, full-text search for \"ipod nano\" will only be performed once, and its results will be reused to build 3 different result sets.\n\n[Faceted search](../Searching/Faceted_search.md) is a particularly important case that benefits from this optimization. Indeed, faceted searching can be implemented by running several queries, one to retrieve search results themselves, and a few others with the same full-text query but different group-by settings to retrieve all the required groups of results (top-3 authors, top-5 vendors, etc). As long as the full-text query and filtering settings stay the same, common query optimization will trigger, and greatly improve performance.\n\n**Common subtree optimization** is even more interesting. It allows `searchd` to exploit similarities between batched full-text queries. It identifies common full-text query parts (subtrees) in all queries and caches them between queries. For example, consider the following query batch:\n\nCODE_BLOCK_2\n\nThere's a common two-word part `donald trump` that can be computed only once, then cached and shared across the queries. And common subtree optimization does just that. Per-query cache size is strictly controlled by [subtree_docs_cache](../Server_settings/Searchd.md#subtree_docs_cache) and [subtree_hits_cache](../Server_settings/Searchd.md#subtree_hits_cache) directives (so that caching *all* sixteen gazillions of documents that match \"i am\" does not exhaust the RAM and instantly kill your server).\n\n<!-- example multi-query 2 -->\nHow can you tell if the queries in the batch were actually optimized? If they were, the respective query log will have a \"multiplier\" field that specifies how many queries were processed together:\n\nNote the \"x3\" field. It means that this query was optimized and processed in a sub-batch of 3 queries.\n\n<!-- intro -->\n##### log:\n\n<!-- request log -->\nCODE_BLOCK_3\n<!-- end -->\n\n<!-- example multi-query 3 -->\nFor reference, this is how the regular log would look like if the queries were not batched:\n\n<!-- intro -->\n##### log:\n\n<!-- request log -->\nCODE_BLOCK_4\n<!-- end -->\n\nNotice how the per-query time in the multi-query case improved by a factor of 1.5x to 2.3x, depending on the specific sorting mode.\n\n## Multi-Query Limitations and Flow\n\nMulti-queries are mainly supported for batching queries and receiving meta-info after such batches. Because of this limitation, only a small subset of statements is allowed in batches. In one batch, you can combine only `SELECT`, `SHOW`, and `SET` statements.\n\nYou can use `SELECT` as usual; however, notice that all queries will be run together in a single pass. If queries are not related, there is no benefit from multi-querying. The daemon will detect this and run the queries one-by-one.",
  34. "translations": {
  35. "chinese": "# \u591a\u67e5\u8be2\n\n\u591a\u67e5\u8be2\uff0c\u6216\u67e5\u8be2\u6279\u5904\u7406\uff0c\u5141\u8bb8\u60a8\u5728\u4e00\u4e2a\u7f51\u7edc\u8bf7\u6c42\u4e2d\u5411 Manticore \u53d1\u9001\u591a\u4e2a\u641c\u7d22\u67e5\u8be2\u3002\n\n\ud83d\udc4d \u4e3a\u4ec0\u4e48\u4f7f\u7528\u591a\u67e5\u8be2\uff1f\n\n\u4e3b\u8981\u539f\u56e0\u5728\u4e8e\u6027\u80fd\u3002\u901a\u8fc7\u5c06\u8bf7\u6c42\u4ee5\u6279\u5904\u7406\u7684\u5f62\u5f0f\u53d1\u9001\u5230 Manticore \u800c\u4e0d\u662f\u9010\u4e2a\u53d1\u9001\uff0c\u53ef\u4ee5\u8282\u7701\u65f6\u95f4\u5e76\u51cf\u5c11\u7f51\u7edc\u5f80\u8fd4\u6b21\u6570\u3002\u6b64\u5916\uff0c\u4ee5\u6279\u5904\u7406\u7684\u5f62\u5f0f\u53d1\u9001\u67e5\u8be2\u53ef\u4ee5\u8ba9 Manticore \u6267\u884c\u67d0\u4e9b\u5185\u90e8\u4f18\u5316\u3002\u5982\u679c\u65e0\u6cd5\u5e94\u7528\u6279\u5904\u7406\u4f18\u5316\uff0c\u67e5\u8be2\u5c06\u9010\u4e2a\u5904\u7406\u3002\n\n\u26d4 \u4f55\u65f6\u4e0d\u4f7f\u7528\u591a\u67e5\u8be2\uff1f\n\n\u591a\u67e5\u8be2\u8981\u6c42\u6279\u5904\u7406\u4e2d\u7684\u6240\u6709\u641c\u7d22\u67e5\u8be2\u90fd\u662f\u72ec\u7acb\u7684\uff0c\u4f46\u8fd9\u5e76\u4e0d\u603b\u662f\u6210\u7acb\u3002\u6709\u65f6\u67e5\u8be2 B \u4f9d\u8d56\u4e8e\u67e5\u8be2 A \u7684\u7ed3\u679c\uff0c\u8fd9\u610f\u5473\u7740\u67e5\u8be2 B \u53ea\u80fd\u5728\u6267\u884c\u67e5\u8be2 A \u4e4b\u540e\u624d\u80fd\u8bbe\u7f6e\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u80fd\u53ea\u60f3\u5728\u4e3b\u8868\u4e2d\u672a\u627e\u5230\u7ed3\u679c\u65f6\u663e\u793a\u6b21\u7ea7\u7d22\u5f15\u7684\u7ed3\u679c\uff0c\u6216\u8005\u60a8\u53ef\u80fd\u9700\u8981\u6839\u636e\u7b2c\u4e00\u4e2a\u7ed3\u679c\u96c6\u4e2d\u7684\u5339\u914d\u6570\u91cf\u6307\u5b9a\u7b2c\u4e8c\u4e2a\u7ed3\u679c\u96c6\u4e2d\u7684\u504f\u79fb\u91cf\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u60a8\u5c06\u9700\u8981\u4f7f\u7528\u5355\u72ec\u7684\u67e5\u8be2\uff08\u6216\u5355\u72ec\u7684\u6279\u5904\u7406\uff09\u3002\n\n\u5f53\u4f7f\u7528\u8fde\u63a5\u5668\u5e93\u65f6\uff0c\u4f8b\u5982 PHP \u4e2d\u7684 `mysqli`\uff0c\u60a8\u53ef\u4ee5\u6dfb\u52a0\u591a\u4e2a\u67e5\u8be2\uff0c\u7136\u540e\u5c06\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6279\u5904\u7406\u8fd0\u884c\u3002\u8fd9\u5c06\u4f5c\u4e3a\u4e00\u4e2a\u5355\u4e2a\u591a\u67e5\u8be2\u6279\u5904\u7406\u5de5\u4f5c\u3002\n\n\u6ce8\u610f\uff1a\u5982\u679c\u60a8\u4f7f\u7528\u63a7\u5236\u53f0 MySQL \u5ba2\u6237\u7aef\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u5b83\u4f1a\u5c06\u5206\u53f7\uff08;\uff09\u89e3\u91ca\u4e3a\u5206\u9694\u7b26\u672c\u8eab\uff0c\u5e76\u9010\u4e2a\u5c06\u6bcf\u4e2a\u67e5\u8be2\u53d1\u9001\u5230\u670d\u52a1\u5668\uff1b\u8fd9\u4e0d\u662f\u4e00\u4e2a\u591a\u67e5\u8be2\u6279\u5904\u7406\u3002\u8981\u8986\u76d6\u6b64\u884c\u4e3a\uff0c\u53ef\u4ee5\u5728\u5ba2\u6237\u7aef\u4fa7\u4f7f\u7528\u5185\u90e8\u547d\u4ee4 `delimiter` \u91cd\u65b0\u5b9a\u4e49\u5206\u9694\u7b26\u3002\u5728\u505a\u51fa\u6b64\u66f4\u6539\u540e\uff0c\u5ba2\u6237\u7aef\u5c06\u53d1\u9001\u6574\u4e2a\u5305\u542b\u5206\u53f7\u7684\u5b57\u7b26\u4e32\uff0c\u5141\u8bb8\u201c\u591a\u67e5\u8be2\u9b54\u6cd5\u201d\u751f\u6548\u3002\n\n\u63a7\u5236\u53f0\u5ba2\u6237\u7aef\u7684\u8fd9\u79cd\u884c\u4e3a\u6709\u65f6\u4f1a\u4ee4\u4eba\u56f0\u60d1\uff0c\u56e0\u4e3a\u60a8\u53ef\u80fd\u4f1a\u6ce8\u610f\u5230\u76f8\u540c\u7684\u547d\u4ee4\u5e8f\u5217\u5728 MySQL \u5ba2\u6237\u7aef\u63a7\u5236\u53f0\u4e2d\u4e0e SQL-over-HTTP \u7b49\u5176\u4ed6\u534f\u8bae\u7684\u884c\u4e3a\u6709\u6240\u4e0d\u540c\u3002\u8fd9\u662f\u56e0\u4e3a MySQL \u63a7\u5236\u53f0\u5ba2\u6237\u7aef\u672c\u8eab\u4f7f\u7528\u5206\u53f7\u6765\u5212\u5206\u67e5\u8be2\uff0c\u4f46\u5176\u4ed6\u534f\u8bae\u53ef\u80fd\u4f1a\u5c06\u6574\u4e2a\u5e8f\u5217\u4f5c\u4e3a\u4e00\u4e2a\u6279\u5904\u7406\u53d1\u9001\u3002\n\n<!-- \u793a\u4f8b\u591a\u67e5\u8be2 1 -->\n\u60a8\u53ef\u4ee5\u4f7f\u7528 SQL \u901a\u8fc7\u5206\u53f7\u5206\u9694\u591a\u4e2a\u641c\u7d22\u67e5\u8be2\u3002\u5f53 Manticore \u4ece\u5ba2\u6237\u7aef\u63a5\u6536\u5230\u683c\u5f0f\u4e3a\u8fd9\u6837\u7684\u67e5\u8be2\u65f6\uff0c\u6240\u6709\u8bed\u53e5\u95f4\u7684\u4f18\u5316\u90fd\u5c06\u88ab\u5e94\u7528\u3002\n\n\u591a\u67e5\u8be2\u4e0d\u652f\u6301\u5e26\u6709 `FACET` \u7684\u67e5\u8be2\u3002\u4e00\u4e2a\u6279\u5904\u7406\u4e2d\u7684\u591a\u67e5\u8be2\u6570\u91cf\u4e0d\u5e94\u8d85\u8fc7 [max_batch_queries](../Server_settings/Searchd.md#max_batch_queries)\u3002\n\n<!-- \u5165\u95e8 -->\n##### SQL\uff1a\n\n<!-- \u8bf7\u6c42 SQL -->\n\nCODE_BLOCK_0\n<!-- \u7ed3\u675f -->\n\n\u4ece\u63a7\u5236\u53f0 MySQL/MariaDB \u5ba2\u6237\u7aef\uff1a\n<!-- \u8bf7\u6c42 SQL -->\n\nCODE_BLOCK_1\n<!-- \u7ed3\u675f -->\n\n## \u591a\u67e5\u8be2\u4f18\u5316\n\n\u6709\u4e24\u79cd\u4e3b\u8981\u7684\u4f18\u5316\u9700\u8981\u4e86\u89e3\uff1a\u516c\u5171\u67e5\u8be2\u4f18\u5316\u548c\u516c\u5171\u5b50\u6811\u4f18\u5316\u3002\n\n**\u516c\u5171\u67e5\u8be2\u4f18\u5316**\u610f\u5473\u7740 `searchd` \u5c06\u8bc6\u522b\u6279\u5904\u7406\u4e2d\u6240\u6709\u4ec5\u6392\u5e8f\u548c\u5206\u7ec4\u8bbe\u7f6e\u4e0d\u540c\u7684\u67e5\u8be2\uff0c\u5e76\u4e14 *\u53ea\u6267\u884c\u4e00\u6b21\u641c\u7d22*\u3002\u4f8b\u5982\uff0c\u5982\u679c\u6279\u5904\u7406\u5305\u542b 3 \u4e2a\u67e5\u8be2\uff0c\u5b83\u4eec\u90fd\u662f\u9488\u5bf9\u201cipod nano\u201d\u7684\uff0c\u4f46\u7b2c\u4e00\u4e2a\u67e5\u8be2\u8bf7\u6c42\u6309\u4ef7\u683c\u6392\u5e8f\u7684\u524d 10 \u4e2a\u7ed3\u679c\uff0c\u7b2c\u4e8c\u4e2a\u67e5\u8be2\u6309\u4f9b\u5e94\u5546 ID \u5206\u7ec4\u5e76\u8bf7\u6c42\u6309\u8bc4\u5206\u6392\u5e8f\u7684\u524d 5 \u4e2a\u4f9b\u5e94\u5546\uff0c\u7b2c\u4e09\u4e2a\u67e5\u8be2\u8bf7\u6c42\u6700\u9ad8\u4ef7\u683c\uff0c\u5168\u6587\u641c\u7d22\u201cipod nano\u201d\u5c06\u53ea\u6267\u884c\u4e00\u6b21\uff0c\u5e76\u4e14\u5176\u7ed3\u679c\u5c06\u88ab\u91cd\u7528\u4ee5\u6784\u5efa 3 \u4e2a\u4e0d\u540c\u7684\u7ed3\u679c\u96c6\u3002\n\n[\u5206\u9762\u641c\u7d22](../Searching/Faceted_search.md) \u662f\u7279\u522b\u91cd\u8981\u7684\u4e00\u79cd\u60c5\u51b5\uff0c\u53ef\u4ee5\u4ece\u8fd9\u79cd\u4f18\u5316\u4e2d\u53d7\u76ca\u3002\u786e\u5b9e\uff0c\u5206\u9762\u641c\u7d22\u53ef\u4ee5\u901a\u8fc7\u8fd0\u884c\u51e0\u4e2a\u67e5\u8be2\u6765\u5b9e\u73b0\uff0c\u4e00\u4e2a\u67e5\u8be2\u7528\u4e8e\u68c0\u7d22\u641c\u7d22\u7ed3\u679c\u672c\u8eab\uff0c\u51e0\u4e2a\u5176\u4ed6\u67e5\u8be2\u5e26\u6709\u76f8\u540c\u7684\u5168\u6587\u67e5\u8be2\u4f46\u4e0d\u540c\u7684\u5206\u7ec4\u8bbe\u7f6e\uff0c\u4ee5\u68c0\u7d22\u6240\u6709\u6240\u9700\u7684\u5206\u7ec4\u7ed3\u679c\uff08\u524d 3 \u4f4d\u4f5c\u8005\uff0c\u524d 5 \u4f4d\u4f9b\u5e94\u5546\u7b49\uff09\u3002\u53ea\u8981\u5168\u6587\u67e5\u8be2\u548c\u8fc7\u6ee4\u8bbe\u7f6e\u4fdd\u6301\u4e0d\u53d8\uff0c\u516c\u5171\u67e5\u8be2\u4f18\u5316\u5c31\u4f1a\u89e6\u53d1\uff0c\u5e76\u5927\u5927\u63d0\u9ad8\u6027\u80fd\u3002\n\n**\u516c\u5171\u5b50\u6811\u4f18\u5316**\u66f4\u52a0\u6709\u8da3\u3002\u5b83\u5141\u8bb8 `searchd` \u5229\u7528\u6279\u5904\u7406\u4e2d\u7684\u5168\u6587\u67e5\u8be2\u4e4b\u95f4\u7684\u76f8\u4f3c\u6027\u3002\u5b83\u4f1a\u8bc6\u522b\u6240\u6709\u67e5\u8be2\u4e2d\u7684\u516c\u5171\u5168\u6587\u67e5\u8be2\u90e8\u5206\uff08\u5b50\u6811\uff09\uff0c\u5e76\u5728\u67e5\u8be2\u4e4b\u95f4\u7f13\u5b58\u5b83\u4eec\u3002\u4f8b\u5982\uff0c\u8003\u8651\u4ee5\u4e0b\u67e5\u8be2\u6279\u5904\u7406\uff1a\n\nCODE_BLOCK_2\n\n\u6709\u4e00\u4e2a\u516c\u5171\u7684\u4e24\u8bcd\u90e8\u5206 `donald trump`\uff0c\u5b83\u53ea\u9700\u8981\u8ba1\u7b97\u4e00\u6b21\uff0c\u7136\u540e\u7f13\u5b58\u5e76\u5171\u4eab\u7ed9\u6240\u6709\u67e5\u8be2\u3002\u516c\u5171\u5b50\u6811\u4f18\u5316\u6b63\u662f\u8fd9\u6837\u505a\u7684\u3002\u6bcf\u4e2a\u67e5\u8be2\u7684\u7f13\u5b58\u5927\u5c0f\u7531 [subtree_docs_cache](../Server_settings/Searchd.md#subtree_docs_cache) \u548c [subtree_hits_cache](../Server_settings/Searchd.md#subtree_hits_cache) \u6307\u4ee4\u4e25\u683c\u63a7\u5236\uff08\u4ee5\u786e\u4fdd\u7f13\u5b58\u6240\u6709 160 \u4ebf\u4e2a\u5339\u914d\u201ci am\u201d\u7684\u6587\u6863\u4e0d\u4f1a\u8017\u5c3d\u5185\u5b58\u5e76\u7acb\u5373\u6740\u6b7b\u60a8\u7684\u670d\u52a1\u5668\uff09\u3002\n\n<!-- \u793a\u4f8b\u591a\u67e5\u8be2 2 -->\n\u5982\u4f55\u77e5\u9053\u6279\u5904\u7406\u4e2d\u7684\u67e5\u8be2\u662f\u5426\u5b9e\u9645\u8fdb\u884c\u4e86\u4f18\u5316\uff1f\u5982\u679c\u8fdb\u884c\u4e86\u4f18\u5316\uff0c\u76f8\u5e94\u7684\u67e5\u8be2\u65e5\u5fd7\u5c06\u6709\u4e00\u4e2a\u201c\u500d\u6570\u201d\u5b57\u6bb5\uff0c\u6307\u5b9a\u4e86\u4e00\u8d77\u5904\u7406\u4e86\u591a\u5c11\u4e2a\u67e5\u8be2\uff1a\n\n\u6ce8\u610f\u201cx3\u201d\u5b57\u6bb5\u3002\u8fd9\u610f\u5473\u7740\u6b64\u67e5\u8be2\u88ab\u4f18\u5316\u5e76\u4f5c\u4e3a\u4e00\u4e2a\u5b50\u6279\u5904\u7406\u4e2d\u7684 3 \u4e2a\u67e5\u8be2\u4e00\u8d77\u5904\u7406\u3002\n\n<!-- \u5165\u95e8 -->\n##### \u65e5\u5fd7\uff1a\n\n<!-- \u8bf7\u6c42\u65e5\u5fd7 -->\nCODE_BLOCK_3\n<!-- \u7ed3\u675f -->\n\n<!-- \u793a\u4f8b\u591a\u67e5\u8be2 3 -->\n\u4f5c\u4e3a\u53c2\u8003\uff0c\u5982\u679c\u67e5\u8be2\u672a\u6279\u5904\u7406\uff0c\u5e38\u89c4\u65e5\u5fd7\u5c06\u5982\u4e0b\u6240\u793a\uff1a\n\n<!-- \u5165\u95e8 -->\n##### \u65e5\u5fd7\uff1a\n\n<!-- \u8bf7\u6c42\u65e5\u5fd7 -->\nCODE_BLOCK_4\n<!-- \u7ed3\u675f -->\n\n\u6ce8\u610f\uff0c\u5728\u591a\u67e5\u8be2\u60c5\u51b5\u4e0b\uff0c\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u63d0\u9ad8\u4e86 1.5 \u5230 2.3 \u500d\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u7279\u5b9a\u7684\u6392\u5e8f\u6a21\u5f0f\u3002\n\n## \u591a\u67e5\u8be2\u9650\u5236\u548c\u6d41\u7a0b\n\n\u591a\u67e5\u8be2\u4e3b\u8981\u7528\u4e8e\u6279\u5904\u7406\u67e5\u8be2\u5e76\u63a5\u6536\u6b64\u7c7b\u6279\u5904\u7406\u7684\u5143\u6570\u636e\u3002\u7531\u4e8e\u8fd9\u4e00\u9650\u5236\uff0c\u6279\u5904\u7406\u4e2d\u53ea\u5141\u8bb8\u4e00\u5c0f\u90e8\u5206\u8bed\u53e5\u3002\u5728\u4e00\u4e2a\u6279\u5904\u7406\u4e2d\uff0c\u60a8\u53ef\u4ee5\u7ec4\u5408 `SELECT`\u3001`SHOW` \u548c `SET` \u8bed\u53e5\u3002\n\n\u60a8\u53ef\u4ee5\u50cf\u5e73\u5e38\u4e00\u6837\u4f7f\u7528 `SELECT`\uff1b\u7136\u800c\uff0c\u8bf7\u6ce8\u610f\uff0c\u6240\u6709\u67e5\u8be2\u5c06\u5728\u4e00\u6b21\u901a\u8fc7\u4e2d\u8fd0\u884c\u3002\u5982\u679c\u67e5\u8be2\u4e4b\u95f4\u6ca1\u6709\u5173\u8054\uff0c\u591a\u67e5\u8be2\u5c31\u6ca1\u6709\u597d\u5904\u3002\u5b88\u62a4\u8fdb\u7a0b\u4f1a\u68c0\u6d4b\u5230\u8fd9\u4e00\u70b9\uff0c\u5e76\u9010\u4e2a\u8fd0\u884c\u67e5\u8be2\u3002",
  36. "russian": "# \u041c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441\u044b\n\n\u041c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0438\u043b\u0438 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 Manticore \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430.\n\n\ud83d\udc4d \u0417\u0430\u0447\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441\u044b?\n\n\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u2014 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 Manticore \u043f\u0430\u043a\u0435\u0442\u043e\u043c, \u0430 \u043d\u0435 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443, \u0432\u044b \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u0435 \u0432\u0440\u0435\u043c\u044f \u0437\u0430 \u0441\u0447\u0435\u0442 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043e\u0431\u0445\u043e\u0434\u043e\u0432. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u0430\u043a\u0435\u0442\u043e\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 Manticore \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0430\u043a\u0435\u0442\u0430 \u043d\u0435\u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u044b, \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.\n\n\u26d4 \u041a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441\u044b?\n\n\u041c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0442\u0440\u0435\u0431\u0443\u044e\u0442, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 \u0431\u044b\u043b\u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c\u0438, \u0447\u0442\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0442\u0430\u043a. \u0418\u043d\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 B \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 A, \u0442\u043e \u0435\u0441\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 B \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 A. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u0442\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438\u0437 \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u043e\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432, \u0438\u043b\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0439 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432. \u0412 \u044d\u0442\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b (\u0438\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b).\n\n\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a-\u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a `mysqli` \u0432 PHP, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0438\u0445 \u0432\u0441\u0435 \u043a\u0430\u043a \u0435\u0434\u0438\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u043e\u0434\u0438\u043d \u043f\u0430\u043a\u0435\u0442 \u043c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.\n\n\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442 MySQL, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u043d \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u0442 \u0442\u043e\u0447\u043a\u0443 \u0441 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 (;) \u043a\u0430\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438; \u044d\u0442\u043e \u043d\u0435 \u043f\u0430\u043a\u0435\u0442 \u043c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0427\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u044d\u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b `delimiter`. \u041f\u043e\u0441\u043b\u0435 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u0441\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0442\u043e\u0447\u043a\u0430\u043c\u0438 \u0441 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \"\u043c\u0430\u0433\u0438\u0438 \u043c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\".\n\n\u0422\u0430\u043a\u043e\u0435 \u043f\u043e\u0431\u043e\u0447\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0447\u0430\u0441\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0431\u0438\u0432\u0430\u0442\u044c \u0441 \u0442\u043e\u043b\u043a\u0443, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u0434\u043d\u0430 \u0438 \u0442\u0430 \u0436\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434 \u0432\u0435\u0434\u0435\u0442 \u0441\u0435\u0431\u044f \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 MySQL \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c, \u0442\u0430\u043a\u0438\u043c \u043a\u0430\u043a SQL-over-HTTP. \u042d\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0441\u0430\u043c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442 MySQL \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u043e\u0447\u0435\u043a \u0441 \u0437\u0430\u043f\u044f\u0442\u043e\u0439, \u043d\u043e \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044b \u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u0441\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u0430\u043a \u0435\u0434\u0438\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442.\n\n<!-- example multi-query 1 -->\n\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e SQL, \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0432 \u0438\u0445 \u0442\u043e\u0447\u043a\u043e\u0439 \u0441 \u0437\u0430\u043f\u044f\u0442\u043e\u0439. \u041a\u043e\u0433\u0434\u0430 Manticore \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u0442\u0430\u043a\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u043e\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u044b \u0432\u0441\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438.\n\n\u041c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441 `FACET`. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u043e\u0434\u043d\u043e\u043c \u043f\u0430\u043a\u0435\u0442\u0435 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0442\u044c [max_batch_queries](../Server_settings/Searchd.md#max_batch_queries).\n\n<!-- intro -->\n##### SQL:\n\n<!-- request SQL -->\n\nCODE_BLOCK_0\n<!-- end -->\n\n\u0418\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430 MySQL/MariaDB:\n<!-- request SQL -->\n\nCODE_BLOCK_1\n<!-- end -->\n\n## \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\n\n\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0432\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u043d\u0430\u0442\u044c: \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0449\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0449\u0438\u0445 \u043f\u043e\u0434\u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432.\n\n**\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0449\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432** \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e `searchd` \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442 \u0432\u0441\u0435 \u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u043f\u0430\u043a\u0435\u0442\u0435, \u0433\u0434\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0438 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438, \u0438 *\u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442 \u043f\u043e\u0438\u0441\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437*. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043f\u0430\u043a\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 3 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0432\u0441\u0435 \u043e\u043d\u0438 \u0434\u043b\u044f \"ipod nano\", \u043d\u043e 1-\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u043f-10 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432, \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0446\u0435\u043d\u0435, 2-\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u0435\u0442 \u043f\u043e ID \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u0430 \u0438 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u043f-5 \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u043e\u0432, \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0443, \u0430 3-\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0446\u0435\u043d\u0443, \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043f\u043e \"ipod nano\" \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u0438 \u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f 3 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432.\n\n[\u0424\u0430\u0441\u0435\u0442\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a](../Searching/Faceted_search.md) \u2014 \u044d\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432\u0430\u0436\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442 \u043e\u0442 \u044d\u0442\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0444\u0430\u0441\u0435\u0442\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u043f\u0443\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432: \u043e\u0434\u0438\u043d \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0430\u043c\u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u043e\u0438\u0441\u043a\u0430, \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u0441 \u0442\u0435\u043c \u0436\u0435 \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c, \u043d\u043e \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0445 \u0433\u0440\u0443\u043f\u043f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 (\u0442\u043e\u043f-3 \u0430\u0432\u0442\u043e\u0440\u0430, \u0442\u043e\u043f-5 \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u043e\u0432 \u0438 \u0442.\u0434.). \u041f\u043e\u043a\u0430 \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u044b\u043c\u0438, \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0449\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0432\u044b\u0441\u0438\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.\n\n**\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0449\u0438\u0445 \u043f\u043e\u0434\u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432** \u0435\u0449\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435. \u041e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 `searchd` \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430 \u043c\u0435\u0436\u0434\u0443 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u043c\u0438 \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438. \u041e\u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043e\u0431\u0449\u0438\u0435 \u0447\u0430\u0441\u0442\u0438 \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 (\u043f\u043e\u0434\u0434\u0435\u0440\u0435\u0432\u044c\u044f) \u0432\u043e \u0432\u0441\u0435\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445 \u0438 \u043a\u044d\u0448\u0438\u0440\u0443\u0435\u0442 \u0438\u0445 \u043c\u0435\u0436\u0434\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0430\u043a\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432:\n\nCODE_BLOCK_2\n\n\u0415\u0441\u0442\u044c \u043e\u0431\u0449\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0438\u0437 \u0434\u0432\u0443\u0445 \u0441\u043b\u043e\u0432 `donald trump`, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043e \u0432\u0441\u0435\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445. \u0418 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0449\u0438\u0445 \u043f\u043e\u0434\u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e. \u0420\u0430\u0437\u043c\u0435\u0440 \u043a\u044d\u0448\u0430 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u0442\u0440\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430\u043c\u0438 [subtree_docs_cache](../Server_settings/Searchd.md#subtree_docs_cache) \u0438 [subtree_hits_cache](../Server_settings/Searchd.md#subtree_hits_cache) (\u0447\u0442\u043e\u0431\u044b \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 *\u0432\u0441\u0435\u0445* \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0438 \u0433\u0430\u0437\u0438\u043b\u043b\u0438\u043e\u043d\u043e\u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \"i am\", \u043d\u0435 \u0438\u0441\u0447\u0435\u0440\u043f\u0430\u043b\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u043d\u0435 \u0443\u0431\u0438\u043b\u043e \u0432\u0430\u0448 \u0441\u0435\u0440\u0432\u0435\u0440).\n\n<!-- example multi-query 2 -->\n\u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0431\u044b\u043b\u0438 \u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b? \u0415\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0436\u0443\u0440\u043d\u0430\u043b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043f\u043e\u043b\u0435 \"multiplier\", \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u0435, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0431\u044b\u043b\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043e \u0432\u043c\u0435\u0441\u0442\u0435:\n\n\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u043e\u043b\u0435 \"x3\". \u041e\u043d\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0431\u044b\u043b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0432 \u043f\u043e\u0434\u043f\u0430\u043a\u0435\u0442\u0435 \u0438\u0437 3 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.\n\n<!-- intro -->\n##### log:\n\n<!-- request log -->\nCODE_BLOCK_3\n<!-- end -->\n\n<!-- example multi-query 3 -->\n\u0414\u043b\u044f \u0441\u043f\u0440\u0430\u0432\u043a\u0438, \u0432\u043e\u0442 \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u0431\u044b \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0436\u0443\u0440\u043d\u0430\u043b, \u0435\u0441\u043b\u0438 \u0431\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0435 \u0431\u044b\u043b\u0438 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u043c\u0438:\n\n<!-- intro -->\n##### log:\n\n<!-- request log -->\nCODE_BLOCK_4\n<!-- end -->\n\n\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043a\u0430\u043a \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0443\u043b\u0443\u0447\u0448\u0438\u043b\u043e\u0441\u044c \u0432 1,5\u20132,3 \u0440\u0430\u0437\u0430 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0440\u0435\u0436\u0438\u043c\u0430 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438.\n\n## \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0442\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\n\n\u041c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u0430\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e\u0441\u043b\u0435 \u0442\u0430\u043a\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432. \u0418\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0432 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432. \u0412 \u043e\u0434\u043d\u043e\u043c \u043f\u0430\u043a\u0435\u0442\u0435 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b `SELECT`, `SHOW` \u0438 `SET`.\n\n\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c `SELECT` \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e; \u043e\u0434\u043d\u0430\u043a\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0437\u0430 \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0445\u043e\u0434. \u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u044b, \u043d\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u044b \u043e\u0442 \u043c\u0443\u043b\u044c\u0442\u0438\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0414\u0435\u043c\u043e\u043d \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442 \u044d\u0442\u043e \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443."
  37. },
  38. "is_code_or_comment": false,
  39. "model": "deepseek/deepseek-v3.2",
  40. "updated_at": 1766382896
  41. },
  42. "__meta": {
  43. "source_text": "# Multi-queries\n\nMulti-queries, or query batches, allow you to send multiple search queries to Manticore in a single network request.\n\n\ud83d\udc4d Why use multi-queries?\n\nThe primary reason is performance. By sending requests to Manticore in a batch instead of one by one, you save time by reducing network round-trips. Additionally, sending queries in a batch allows Manticore to perform certain internal optimizations. If no batch optimizations can be applied, queries will be processed individually.\n\n\u26d4 When not to use multi-queries?\n\nMulti-queries require all search queries in a batch to be independent, which isn't always the case. Sometimes query B depends on query A's results, meaning query B can only be set up after executing query A. For example, you might want to display results from a secondary index only if no results were found in the primary table, or you may want to specify an offset into the 2nd result set based on the number of matches in the 1st result set. In these cases, you'll need to use separate queries (or separate batches).\n\nWhen using connector libraries, such as `mysqli` in PHP, you can add multiple queries and then run them all as a single batch. This will work as a single multi-query batch.\n\nNote: If you use a console MySQL client, by default it interprets the semicolon (;) as the delimiter itself, and sends each query to the server individually; this is not a multi-query batch. To override this behavior, redefine the separator on the client-side to another character using the internal command `delimiter`. After making this change, the client will send the entire string with semicolons unchanged, allowing the \"multi-query magic\" to work.\n\nThis aside behavior of the console client can often be confusing because you might notice that one and the same sequence of commands behaves differently in the MySQL client console compared to another protocol like SQL-over-HTTP. This is exactly because the MySQL console client itself divides queries using semicolons, but other protocols may send an entire sequence as a single batch.\n\n<!-- example multi-query 1 -->\nYou can run multiple search queries with SQL by separating them with a semicolon. When Manticore receives a query formatted like this from a client, all inter-statement optimizations will be applied.\n\nMulti-queries don't support queries with `FACET`. The number of multi-queries in one batch shouldn't exceed [max_batch_queries](../Server_settings/Searchd.md#max_batch_queries).\n\n\n<!-- intro -->\n##### SQL:\n\n<!-- request SQL -->\n\n```sql\nSELECT id, price FROM products WHERE MATCH('remove hair') ORDER BY price DESC; SELECT id, price FROM products WHERE MATCH('remove hair') ORDER BY price ASC\n```\n<!-- end -->\n\nFrom a console MySQL/MariaDB client:\n<!-- request SQL -->\n\n```sql\nDELIMITER _\nSELECT id, price FROM products WHERE MATCH('remove hair') ORDER BY price DESC; SELECT id, price FROM products WHERE MATCH('remove hair') ORDER BY price ASC_\n```\n<!-- end -->\n\n## Multi-queries optimizations\n\nThere are two major optimizations to be aware of: common query optimization and common subtree optimization.\n\n**Common query optimization** means that `searchd` will identify all those queries in a batch where only the sorting and group-by settings differ, and *only perform searching once*. For example, if a batch consists of 3 queries, all of them are for \"ipod nano\", but the 1st query requests the top-10 results sorted by price, the 2nd query groups by vendor ID and requests the top-5 vendors sorted by rating, and the 3rd query requests the max price, full-text search for \"ipod nano\" will only be performed once, and its results will be reused to build 3 different result sets.\n\n[Faceted search](../Searching/Faceted_search.md) is a particularly important case that benefits from this optimization. Indeed, faceted searching can be implemented by running several queries, one to retrieve search results themselves, and a few others with the same full-text query but different group-by settings to retrieve all the required groups of results (top-3 authors, top-5 vendors, etc). As long as the full-text query and filtering settings stay the same, common query optimization will trigger, and greatly improve performance.\n\n**Common subtree optimization** is even more interesting. It allows `searchd` to exploit similarities between batched full-text queries. It identifies common full-text query parts (subtrees) in all queries and caches them between queries. For example, consider the following query batch:\n\n```bash\ndonald trump president\ndonald trump barack obama john mccain\ndonald trump speech\n```\n\nThere's a common two-word part `donald trump` that can be computed only once, then cached and shared across the queries. And common subtree optimization does just that. Per-query cache size is strictly controlled by [subtree_docs_cache](../Server_settings/Searchd.md#subtree_docs_cache) and [subtree_hits_cache](../Server_settings/Searchd.md#subtree_hits_cache) directives (so that caching *all* sixteen gazillions of documents that match \"i am\" does not exhaust the RAM and instantly kill your server).\n\n<!-- example multi-query 2 -->\nHow can you tell if the queries in the batch were actually optimized? If they were, the respective query log will have a \"multiplier\" field that specifies how many queries were processed together:\n\nNote the \"x3\" field. It means that this query was optimized and processed in a sub-batch of 3 queries.\n\n\n<!-- intro -->\n##### log:\n\n<!-- request log -->\n```bash\n[Sun Jul 12 15:18:17.000 2009] 0.040 sec x3 [ext/0/rel 747541 (0,20)] [lj] the\n[Sun Jul 12 15:18:17.000 2009] 0.040 sec x3 [ext/0/ext 747541 (0,20)] [lj] the\n[Sun Jul 12 15:18:17.000 2009] 0.040 sec x3 [ext/0/ext 747541 (0,20)] [lj] the\n```\n<!-- end -->\n\n<!-- example multi-query 3 -->\nFor reference, this is how the regular log would look like if the queries were not batched:\n\n\n<!-- intro -->\n##### log:\n\n<!-- request log -->\n```bash\n[Sun Jul 12 15:18:17.062 2009] 0.059 sec [ext/0/rel 747541 (0,20)] [lj] the\n[Sun Jul 12 15:18:17.156 2009] 0.091 sec [ext/0/ext 747541 (0,20)] [lj] the\n[Sun Jul 12 15:18:17.250 2009] 0.092 sec [ext/0/ext 747541 (0,20)] [lj] the\n```\n<!-- end -->\n\nNotice how the per-query time in the multi-query case improved by a factor of 1.5x to 2.3x, depending on the specific sorting mode.\n\n## Multi-Query Limitations and Flow\n\nMulti-queries are mainly supported for batching queries and receiving meta-info after such batches. Because of this limitation, only a small subset of statements is allowed in batches. In one batch, you can combine only `SELECT`, `SHOW`, and `SET` statements.\n\nYou can use `SELECT` as usual; however, notice that all queries will be run together in a single pass. If queries are not related, there is no benefit from multi-querying. The daemon will detect this and run the queries one-by-one.\n\nYou can use `SHOW` for processing *warnings*, *status*, *agent status*, *meta*, *profile*, and *plan*. All other `SHOW` statements in batches will be silently ignored with no output. For example, you cannot execute `SHOW TABLES`, `SHOW THREADS`, or `SHOW VARIABLES`, or any other statement not mentioned above, when batching.\n\nYou can use `SET` only for `SET PROFILING`. All other `SET ...` commands will be silently ignored.\n\nThe order of execution is also different. The daemon processes batches in two passes.\n\nFirst, it collects all `SELECT` statements and runs all `SET PROFILING` statements it sees simultaneously. As a side effect, only the last `SET PROFILING` statement is effective. If you execute a multi-query like this: `SET PROFILING=1; SELECT...; SHOW META; SHOW PROFILE; SET PROFILING=0`, you will not see any profile, because on the first pass, the daemon executes `SET PROFILING=1` and then immediately `SET PROFILING=0`.\n\nSecond, the daemon attempts to execute a single batch query with all collected `SELECT` statements. If statements are not related, it will execute them one-by-one.\n\nFinally, it iterates over the initial batch sequence and returns the sub-result data and meta from the resultset for\neach `SELECT` and `SHOW`. Since all `SET PROFILING` statements were executed in the first pass, they are skipped on this second pass.",
  44. "updated_at": 1768530797,
  45. "source_md5": "aceb572ed9ac74a3657931c2e517e020"
  46. }
  47. }