Python模糊查询本地文件夹去除文件后缀 import os,re def fuzzy_search(path): word= input('请输入要查询的内容:') for filename in os.listdir(path): #遍历指定文件夹 re_filename = re.findall('.\w+', str(filename)) #去除文件后缀名 if word in re_filename[0]: print(re_filename[0])
记录常用的es 查询 聚合 GET _cat / indices GET / p_ext_develop / _mapping / g GET / p_ext_develop / _analyze { "field": "other_name_en", "text": "(3S)-N-Boc-2-azabicyclo[2.2.1]heptane-3-carboxylicacid;"} GET / hs2840 / _analy
# es 查询更新操作# _*_ coding: utf-8 _*_ import time import datetime import pymysql from elasticsearch import Elasticsearch from urllib3.connectionpool import xrange # class EsClient(): es_host = "192.168.8.190" port = 9200 timeout = 15000 global inde
本文只是写一些常用es命令,这里不用任何客户端,只用 9200/_plugin/head/ 那个端口网页就可以,然后是复合查询. 注意es其实一个idnex只能有一个type,如果一个index做了多个type,坑...太多了,首先 where不能用,然后 聚合也不能用.至少在es2.*是这样的,这个坑你可以搜索下"_type Field Not Available for Aggregation #5634" 1. 查询所有关键字:match_all等同SQL select * fr