• ElasticSearch 多索引


    1、用逗号将索引隔开,如:
    $ curl -XPOST http://localhost:9200/aaa,website/_search/
    
    {
    
    • "took"1,
    • "timed_out"false,
    • "_shards": {
      • "total"10,
      • "successful"10,
      • "failed"0
      },
    • "hits": {
      • "total"5,
      • "max_score"1,
      • "hits": [
        • {
          • "_index""website",
          • "_type""blog",
          • "_id""123",
          • "_score"1,
          • "_source": {
            • "title""My first blog entry",
            • "text""Just trying this out...",
            • "date""2014/01/01"
            }
          },
        • {
          • "_index""website",
          • "_type""blog",
          • "_id""AVbkih8AltSLRRB7XAun",
          • "_score"1,
          • "_source": {
            • "title""TestTitle",
            • "text""text",
            • "date""2016/09/01"
            }
          },
        • {
          • "_index""website",
          • "_type""blog",
          • "_id""AVbf1AtSyvALLDk8cjpY",
          • "_score"1,
          • "_source": {
            • "title""My 3 blog entry",
            • "text""Still trying this out...",
            • "date""2014/01/01"
            }
          },
        • {
          • "_index""aaa",
          • "_type""aaa",
          • "_id""AVcCopjQzgrwoUDkEMu3",
          • "_score"1,
          • "_source": {
            • "str1""hello",
            • "str2""world"
            }
          },
        • {
          • "_index""aaa",
          • "_type""aaa",
          • "_id""AVcCogrMzgrwoUDkEMu2",
          • "_score"1,
          • "_source": {
            • "str1""hello, world!",
            • "str2""goodbye! world"
            }
          }
        ]
      }

    }

    2、通配符

    elasticsearch还支持使用统配的风格,如使用*匹配任意字符。

    3、数学表达式风格

    最后可以通过add(+)添加一个索引,使用remove(-)去掉一个索引

  • 相关阅读:
    家庭作业有益吗?
    视图、触发器、事务、存储过程、函数
    Navicat使用和pymysql
    表查询
    外键
    MySQL表操作
    进程池线程池、协程
    全局解释器锁及其他用法
    线程
    进程
  • 原文地址:https://www.cnblogs.com/pilihaotian/p/8823137.html
Copyright © 2020-2023  润新知