Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ElasticSearch查询停止处理大量数据_Search_Indexing_<img Src="//i.stack.imgur.com/RUiNP.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch - Fatal编程技术网 elasticsearch,Search,Indexing,elasticsearch" /> elasticsearch,Search,Indexing,elasticsearch" />

ElasticSearch查询停止处理大量数据

ElasticSearch查询停止处理大量数据,search,indexing,elasticsearch,Search,Indexing,elasticsearch,问题是:我有两个相同的设置和映射索引 第一个索引仅包含1个文档。 第二个索引包含同一个文档+16M个其他文档 当我在第一个索引上运行查询时,它会返回文档,但是当我在第二个索引上执行相同的查询时,我什么也没有收到 索引设置: { "tasks_test": { "settings": { "index": { "analysis": { "analyzer": { "tag_analyzer": {

问题是:我有两个相同的
设置
映射
索引

第一个索引仅包含1个文档。
第二个索引包含同一个文档+16M个其他文档

当我在第一个索引上运行查询时,它会返回文档,但是当我在第二个索引上执行相同的查询时,我什么也没有收到

索引设置:

{
  "tasks_test": {
    "settings": {
      "index": {
        "analysis": {
          "analyzer": {
            "tag_analyzer": {
              "filter": [
                "lowercase",
                "tag_filter"
              ],
              "tokenizer": "whitespace",
              "type": "custom"
            }
          },
          "filter": {
            "tag_filter": {
              "type": "word_delimiter",
              "type_table": "# => ALPHA"
            }
          }
        },
        "creation_date": "1444127141035",
        "number_of_replicas": "2",
        "number_of_shards": "5",
        "uuid": "wTe6WVtLRTq0XwmaLb7BLg",
        "version": {
          "created": "1050199"
        }
      }
    }
  }
}
{
  "tasks_test": {
    "mappings": {
      "Task": {
        "dynamic": "false",
        "properties": {
          "format": "dateOptionalTime",
          "include_in_all": false,
          "type": "date"
        },
        "is_private": {
          "type": "boolean"
        },
        "last_timestamp": {
          "type": "integer"
        },
        "name": {
          "analyzer": "tag_analyzer",
          "type": "string"
        },
        "project_id": {
          "include_in_all": false,
          "type": "integer"
        },
        "user_id": {
          "include_in_all": false,
          "type": "integer"
        }
      }
    }
  }
}
{
  "query": {
    "filtered": {
      "query": {
        "bool": {
          "must": [
            [
              {
                "match": {
                  "_all": {
                    "query": "135548",
                    "type": "phrase_prefix"
                  }
                }
              }
            ]
          ]
        }
      },
      "filter": {
        "bool": {
          "must": [
            {
              "term": {
                "is_private": false
              }
            },
            {
              "terms": {
                "project_id": [
                  2
                ]
              }
            },
            {
              "terms": {
                "user_id": [
                  1
                ]
              }
            }
          ]
        }
      }
    }
  }
}
映射:

{
  "tasks_test": {
    "settings": {
      "index": {
        "analysis": {
          "analyzer": {
            "tag_analyzer": {
              "filter": [
                "lowercase",
                "tag_filter"
              ],
              "tokenizer": "whitespace",
              "type": "custom"
            }
          },
          "filter": {
            "tag_filter": {
              "type": "word_delimiter",
              "type_table": "# => ALPHA"
            }
          }
        },
        "creation_date": "1444127141035",
        "number_of_replicas": "2",
        "number_of_shards": "5",
        "uuid": "wTe6WVtLRTq0XwmaLb7BLg",
        "version": {
          "created": "1050199"
        }
      }
    }
  }
}
{
  "tasks_test": {
    "mappings": {
      "Task": {
        "dynamic": "false",
        "properties": {
          "format": "dateOptionalTime",
          "include_in_all": false,
          "type": "date"
        },
        "is_private": {
          "type": "boolean"
        },
        "last_timestamp": {
          "type": "integer"
        },
        "name": {
          "analyzer": "tag_analyzer",
          "type": "string"
        },
        "project_id": {
          "include_in_all": false,
          "type": "integer"
        },
        "user_id": {
          "include_in_all": false,
          "type": "integer"
        }
      }
    }
  }
}
{
  "query": {
    "filtered": {
      "query": {
        "bool": {
          "must": [
            [
              {
                "match": {
                  "_all": {
                    "query": "135548",
                    "type": "phrase_prefix"
                  }
                }
              }
            ]
          ]
        }
      },
      "filter": {
        "bool": {
          "must": [
            {
              "term": {
                "is_private": false
              }
            },
            {
              "terms": {
                "project_id": [
                  2
                ]
              }
            },
            {
              "terms": {
                "user_id": [
                  1
                ]
              }
            }
          ]
        }
      }
    }
  }
}
文档:

{
  "_index": "tasks_test",
  "_type": "Task",
  "_id": "1",
  "_source": {
    "is_private": false,
    "name": "135548- test with number",
    "project_id": 2,
    "user_id": 1
  }
}
查询:

{
  "tasks_test": {
    "settings": {
      "index": {
        "analysis": {
          "analyzer": {
            "tag_analyzer": {
              "filter": [
                "lowercase",
                "tag_filter"
              ],
              "tokenizer": "whitespace",
              "type": "custom"
            }
          },
          "filter": {
            "tag_filter": {
              "type": "word_delimiter",
              "type_table": "# => ALPHA"
            }
          }
        },
        "creation_date": "1444127141035",
        "number_of_replicas": "2",
        "number_of_shards": "5",
        "uuid": "wTe6WVtLRTq0XwmaLb7BLg",
        "version": {
          "created": "1050199"
        }
      }
    }
  }
}
{
  "tasks_test": {
    "mappings": {
      "Task": {
        "dynamic": "false",
        "properties": {
          "format": "dateOptionalTime",
          "include_in_all": false,
          "type": "date"
        },
        "is_private": {
          "type": "boolean"
        },
        "last_timestamp": {
          "type": "integer"
        },
        "name": {
          "analyzer": "tag_analyzer",
          "type": "string"
        },
        "project_id": {
          "include_in_all": false,
          "type": "integer"
        },
        "user_id": {
          "include_in_all": false,
          "type": "integer"
        }
      }
    }
  }
}
{
  "query": {
    "filtered": {
      "query": {
        "bool": {
          "must": [
            [
              {
                "match": {
                  "_all": {
                    "query": "135548",
                    "type": "phrase_prefix"
                  }
                }
              }
            ]
          ]
        }
      },
      "filter": {
        "bool": {
          "must": [
            {
              "term": {
                "is_private": false
              }
            },
            {
              "terms": {
                "project_id": [
                  2
                ]
              }
            },
            {
              "terms": {
                "user_id": [
                  1
                ]
              }
            }
          ]
        }
      }
    }
  }
}
此外,一些调查结果:

  • 如果我用
    name
    替换
    \u all
    ,一切正常
  • 如果我用
    匹配短语
    替换
    匹配短语
    前缀,也会起作用
ES版本:1.5.1


因此,问题是:如何在没有提到黑客的情况下使第二个索引的查询工作?

您确定您的索引具有相同的结构吗?你有没有搞乱了
\u all
字段结构?@EvaldasBuinauskas是的,我已经用索引
设置
映射更新了这个问题