当前位置:首页>python>Python向量搜索实战:让14万文档的检索速度提升54倍!

Python向量搜索实战:让14万文档的检索速度提升54倍!

  • 2026-01-11 03:26:16
Python向量搜索实战:让14万文档的检索速度提升54倍!

关注+星标,每天学习Python新技能

来源:网络

告别传统关键词匹配,用语义搜索解锁法律文档的深层含义

你是否曾为在海量文件(以法律文件为例)中寻找相关判例而头疼?传统的关键词搜索经常错过关键信息——毕竟法律文本的微妙之处往往不在于具体词汇,而在于概念之间的关系

今天,我们就来聊聊如何用Python构建一个闪电般快速的法律文档语义搜索系统。我将带你从零开始,基于澳大利亚高等法院的14.3万份判例文档,构建一个能从毫秒级响应数千并发查询的智能检索系统。

为什么需要向量搜索?

法律文本有其独特之处:

  • 高度专业化:术语密集,语境依赖性强
  • 长文档结构:单个判例可能长达数十页
  • 概念关联复杂:相似的判决理由可能用完全不同的词汇表达

传统的TF-IDF或BM25算法在这里显得力不从心。而向量搜索通过将文本转换为高维空间中的点,让相似的概念彼此靠近,从而实现了“理解语义”的检索。

但问题是:如何在保证检索质量的同时,处理如此大规模的数据?

第一步:选择嵌入模型,先看服务条款!

在开始编码之前,有一个关键步骤大多数开发者都会忽略:仔细阅读嵌入API的服务条款

当我用Claude帮我分析了几大主流嵌入服务提供商的服务条款后,发现了令人惊讶的差异:

提供商
训练数据使用
数据保留
基准测试
免费用户保护
Isaacus
仅当明确提供反馈时
保护所有用户
允许
Google
是(付费用户也会训练)
可能共享
有限制
OpenAI
是(可手动选择退出)
30天删除
允许
Voyage AI
是(可手动选择退出)
未明确
允许

重要发现:如果你处理的是敏感的法律或医疗文档,有些提供商默认会使用你的数据进行模型训练,甚至可能将数据共享或出售给第三方。

这就是为什么我最终选择了Isaacus——不仅因为它的服务条款对用户数据保护最为友好,而且它的kanon-2-embedder模型在后续测试中展现出了出色的性能。

为什么不直接用本地模型?

你可能会问:“为什么不直接在本地运行嵌入模型?” 这确实是一个选项,特别是对于敏感数据。

本地模型的优势:

  • 完全的数据控制
  • 无需担心API限速或价格变动
  • 可以针对特定领域进行微调

但权衡点是质量和便利性:

  • 最好的嵌入模型通常是专有模型,只能通过API访问
  • 本地推理需要GPU资源和管理成本

对于这个项目,我同时测试了API方案和本地方案。本地模型使用的是我在澳大利亚法律语料上微调的BGE-small模型,虽然速度快,但384维的嵌入空间在语义丰富度上无法与API模型的1792-3072维相媲美

第二步:高效获取嵌入向量

异步批处理:速度提升3-5倍

处理14.3万个文本块,如果顺序处理将花费数小时。我们需要异步处理,但要谨慎避免触发API限流:

import asyncioimport numpy as npfrom isaacus import AsyncClientimport os# 设置并发批处理数限制max_concurrent_batches = 5semaphore = asyncio.Semaphore(max_concurrent_batches)asyncdefprocess_batch(batch_texts, client, model_name, task_type):"""处理单批文本的嵌入生成"""asyncwith semaphore:  # 限流控制        response = await client.embed(            model=model_name,            inputs=batch_texts,            task=task_type        )return np.array(response.embeddings, dtype=np.float32)asyncdefgenerate_embeddings_batch(corpus_texts, queries):"""批量生成文档和查询的嵌入向量"""# 初始化客户端    client = AsyncClient(api_key=os.getenv("ISAACUS_API_KEY"))# 准备批处理    batch_size = 100# 根据API限制调整    corpus_batches = [corpus_texts[i:i+batch_size] for i in range(0, len(corpus_texts), batch_size)]# 并行处理文档嵌入    corpus_tasks = []for batch in corpus_batches:        task = process_batch(batch, client, "kanon-2-embedder""retrieval/document")        corpus_tasks.append(task)    corpus_results = await asyncio.gather(*corpus_tasks)    corpus_embeddings = np.vstack(corpus_results)# 生成查询嵌入    query_response = await client.embed(        model="kanon-2-embedder",        inputs=queries,        task="retrieval/query"    )    query_embeddings = np.array(query_response.embeddings, dtype=np.float32)# 保存到本地    os.makedirs("embeddings", exist_ok=True)    np.save("embeddings/corpus_embeddings.npy", corpus_embeddings)    np.save("embeddings/query_embeddings.npy", query_embeddings)await client.close()return corpus_embeddings, query_embeddings# 使用示例corpus_texts = ["The High Court of Australia held that...", ...]  # 14.3万份文档queries = ["What is the doctrine of precedent?""How is negligence established?"]# 运行异步函数corpus_emb, query_emb = asyncio.run(generate_embeddings_batch(corpus_texts, queries))print(f"生成了 {len(corpus_emb)} 个文档嵌入,维度: {corpus_emb.shape[1]}")

性能实测:不同提供商的对比

经过优化后,不同嵌入提供商的性能表现:

批处理速度(处理1000个法律文档):

  • 本地模型(auslaw-embed,384d):924 文本/秒(32GB GPU)
  • OpenAI(text-embedding-3-large,3072d):184 文本/秒
  • Isaacus(kanon-2-embedder,1792d):102 文本/秒
  • Google(gemini-embedding-001,3072d):19.8 文本/秒
  • Voyage AI(voyage-3-large,2048d):14 文本/秒

单查询延迟(用户体验的关键指标):

  • 本地模型:7ms 平均,15ms P95
  • Google:501.1ms 平均,662.3ms P95
  • OpenAI:1,114ms 平均,1,723ms P95
  • Isaacus:1,532ms 平均,2,097ms P95
  • Voyage AI:1,693ms 平均,7,657ms P95

注:P95表示95%的请求比这个时间快,是衡量用户体验的更好指标

第三步:256维度的神奇优化

Isaacus的kanon-2-embedder有一个独特特性:前几个维度携带了大部分语义信息。这让我们可以进行大幅度的维度裁剪:

import numpy as np# 加载完整的嵌入向量corpus_embeddings = np.load("embeddings/corpus_embeddings.npy")# 仅使用前256个维度(从1792维裁剪)corpus_256d = corpus_embeddings[:, :256].astype(np.float32)print(f"原始维度: {corpus_embeddings.shape[1]}")print(f"裁剪后维度: {corpus_256d.shape[1]}")print(f"内存占用减少: {(1 - 256/1792) * 100:.1f}%")

优化效果惊人:

  • 🔥 搜索速度提升8.6倍:从53 q/s到459 q/s
  • 💾 内存占用减少7倍:从1,028 MB到140 MB
  • 📊 **检索质量保留61%**:recall@10指标

重要说明:这里的61% recall@10是相对于1792维全量检索的基准。在实际的RAG(检索增强生成)应用中,这通常足够了——因为检索只是第一步,后续还有重排序和生成步骤。

第四步:USearch实现CPU上的极速检索

现在进入最精彩的部分:如何在不使用GPU的情况下实现毫秒级检索

大多数向量搜索教程会推荐FAISS或Pinecone,但我发现了一个宝藏库:USearch[1]。它通过SIMD优化(现代CPU的并行指令集)在纯CPU上实现了惊人的速度。

安装USearch

pip install usearch numpy

1. 基础版:多线程精确搜索

from usearch.index import search, MetricKind# 使用8个线程进行批量搜索matches = search(    corpus_256d,          # 文档嵌入向量    query_embeddings,     # 查询嵌入向量100,                  # 返回前100个结果    MetricKind.Cos,       # 使用余弦相似度    exact=True,           # 精确搜索    threads=8# 多线程并行)# 结果:374 q/s,相比单线程提升7倍

2. 进阶版:HNSW索引加速

对于查询频率高于更新的场景,构建索引是值得的:

from usearch.index import Indeximport time# 创建HNSW索引index = Index(    ndim=256,             # 向量维度    metric=MetricKind.Cos, # 相似度度量    connectivity=32,      # 连接数(越高质量越好,内存越大)    expansion_add=200,    # 构建时的扩展数    expansion_search=100# 搜索时的扩展数)print("开始构建索引...")start_time = time.time()# 批量添加文档for i, embedding in enumerate(corpus_256d):    index.add(i, embedding)# 进度显示if (i + 1) % 10000 == 0:        print(f"已索引 {i+1}/{len(corpus_256d)} 个文档")build_time = time.time() - start_timeprint(f"索引构建完成,耗时: {build_time:.1f}秒")# 保存索引供后续使用index.save("legal_search_index.usearch")

3. 终极优化:全栈配置

# 准备半精度(16位)的256维向量corpus_256d_half = corpus_embeddings[:, :256].astype(np.float16)index = Index(    ndim=256,    metric=MetricKind.Cos,    dtype="f16",           # 半精度,节省50%内存    connectivity=32,    expansion_add=200,    expansion_search=100)# 快速构建(143K文档仅需59秒)for i, emb in enumerate(corpus_256d_half):    index.add(i, emb)# 查询速度:2,880 q/s!

性能对比:优化前后的惊人差异

优化级别
查询速度
内存占用
Recall@10
适用场景
基准线
53 q/s
1,028 MB
100%
最高精度需求
多线程
374 q/s
1,028 MB
100%
中等规模,需要精确结果
HNSW索引
993 q/s
415 MB
98.6%
生产环境,良好平衡
全栈优化
2,880 q/s
70 MB
61%
大规模RAG,快速初筛

并发处理能力对比

基准系统(53 q/s):

  • 1个用户:19ms响应(良好)
  • 100个并发用户:1.9秒响应(勉强接受)
  • 1,000个并发用户:19秒响应(不可接受)

优化系统(2,880 q/s):

  • 1个用户:0.35ms响应(极快)
  • 100个并发用户:35ms响应(优秀)
  • 1,000个并发用户:347ms响应(良好)
  • 10,000个并发用户:3.5秒响应(可接受)

完整生产级代码实现

下面是一个完整的、可投入生产的法律文档搜索系统:

import numpy as npfrom usearch.index import Index, search, MetricKindfrom pathlib import Pathfrom typing import Optional, Union, List, Tupleimport timeimport jsonclassLegalDocumentSearcher:"""法律文档语义搜索引擎"""def__init__(        self,        corpus_embeddings: np.ndarray,        optimization_level: str = "balanced",        index_path: Optional[str] = None    ):"""        初始化搜索引擎        参数:            corpus_embeddings: 文档嵌入向量,形状为 (n_docs, n_dims)            optimization_level: 优化级别 - "accuracy"|"balanced"|"speed"            index_path: 索引保存路径(可选)        """        self.corpus_embeddings = corpus_embeddings        self.optimization_level = optimization_level        self.index_path = index_path# 根据优化级别配置参数        self._configure_optimization()# 准备文档向量        self._prepare_corpus()# 构建或加载索引        self.index = self._setup_index()def_configure_optimization(self):"""根据优化级别配置参数"""        configs = {"speed": {"dimensions"256,"use_index"True,"dtype""f16","connectivity"32,"expansion_add"200,"expansion_search"100            },"balanced": {"dimensions"None,  # 使用所有维度"use_index"True,"dtype""f32","connectivity"32,"expansion_add"200,"expansion_search"100            },"accuracy": {"dimensions"None,"use_index"False,"dtype""f32","connectivity"None,"expansion_add"None,"expansion_search"None            }        }if self.optimization_level notin configs:raise ValueError(f"优化级别必须是: {list(configs.keys())}")        config = configs[self.optimization_level]for key, value in config.items():            setattr(self, key, value)def_prepare_corpus(self):"""预处理文档嵌入向量"""if self.dimensions:# 裁剪维度            self.corpus_processed = self.corpus_embeddings[:, :self.dimensions]            print(f"维度裁剪: {self.corpus_embeddings.shape[1]} -> {self.dimensions}")else:            self.corpus_processed = self.corpus_embeddings# 转换数据类型if self.dtype == "f16":            self.corpus_processed = self.corpus_processed.astype(np.float16)else:            self.corpus_processed = self.corpus_processed.astype(np.float32)# 确保内存连续(SIMD优化需要)        self.corpus_processed = np.ascontiguousarray(self.corpus_processed)def_setup_index(self):"""设置索引(构建或加载)"""ifnot self.use_index:returnNone# 如果有保存的索引,直接加载if self.index_path and Path(self.index_path).exists():            print(f"加载索引: {self.index_path}")            index = Index.restore(self.index_path)# 加载元数据            meta_path = f"{self.index_path}.meta.json"if Path(meta_path).exists():with open(meta_path, 'r'as f:                    self.metadata = json.load(f)return index# 否则构建新索引        print("构建HNSW索引...")        start_time = time.time()        ndim = self.dimensions or self.corpus_embeddings.shape[1]        index = Index(            ndim=ndim,            metric=MetricKind.Cos,            dtype=self.dtype,            connectivity=self.connectivity,            expansion_add=self.expansion_add,            expansion_search=self.expansion_search        )# 添加文档向量        n_docs = len(self.corpus_processed)for i, embedding in enumerate(self.corpus_processed):            index.add(i, embedding)if (i + 1) % 10000 == 0:                print(f"进度: {i+1}/{n_docs}")        build_time = time.time() - start_time        print(f"索引构建完成,耗时: {build_time:.1f}秒")# 保存索引if self.index_path:            index.save(self.index_path)            self._save_metadata()return indexdef_save_metadata(self):"""保存索引元数据"""        metadata = {"optimization_level": self.optimization_level,"dimensions": self.dimensions,"dtype": self.dtype,"corpus_size": len(self.corpus_processed),"embedding_dim": self.corpus_embeddings.shape[1],"build_time": time.strftime("%Y-%m-%d %H:%M:%S")        }if self.index_path:            meta_path = f"{self.index_path}.meta.json"with open(meta_path, 'w'as f:                json.dump(metadata, f, indent=2)defsearch(        self,        query_embedding: np.ndarray,        k: int = 10,        include_scores: bool = False    ) -> Union[List[int], Tuple[List[int], List[float]]]:"""        搜索相似文档        参数:            query_embedding: 查询嵌入向量            k: 返回的结果数量            include_scores: 是否包含相似度分数        返回:            文档索引列表(或包含分数的元组)        """# 确保查询向量维度匹配if self.dimensions:            query_processed = query_embedding[:self.dimensions]else:            query_processed = query_embedding        query_processed = query_processed.astype(np.float32)if self.use_index and self.index:# 使用HNSW索引搜索            matches = self.index.search(query_processed, k)if include_scores:# 余弦相似度转换为距离                scores = [1 - dist for dist in matches.distances]return matches.keys.tolist(), scoresreturn matches.keys.tolist()else:# 精确搜索(多线程)            matches = search(                self.corpus_processed,                query_processed.reshape(1-1),                k,                MetricKind.Cos,                exact=True,                threads=8            )if include_scores:                scores = [1 - dist for dist in matches.distances[0]]return matches.keys[0].tolist(), scoresreturn matches.keys[0].tolist()defbatch_search(        self,        query_embeddings: np.ndarray,        k: int = 10    ) -> List[List[int]]:"""批量搜索"""        results = []for query in query_embeddings:            doc_indices = self.search(query, k)            results.append(doc_indices)return results# 使用示例defmain():# 加载嵌入向量    print("加载文档嵌入向量...")    corpus_embeddings = np.load("embeddings/corpus_embeddings.npy")# 创建搜索器(使用平衡模式)    print("初始化搜索引擎...")    searcher = LegalDocumentSearcher(        corpus_embeddings=corpus_embeddings,        optimization_level="balanced",  # 速度与质量的平衡        index_path="indices/legal_search_balanced.usearch"    )# 示例查询from isaacus import AsyncClientimport asyncioasyncdeftest_search():        client = AsyncClient(api_key=os.getenv("ISAACUS_API_KEY"))# 测试查询        test_queries = ["What constitutes negligence in Australian law?","How is the doctrine of precedent applied?","What are the elements of a valid contract?"        ]# 生成查询嵌入        response = await client.embed(            model="kanon-2-embedder",            inputs=test_queries,            task="retrieval/query"        )        query_embeddings = np.array(response.embeddings, dtype=np.float32)await client.close()# 执行搜索for i, query in enumerate(test_queries):            print(f"\n查询: '{query}'")            start_time = time.time()            results, scores = searcher.search(query_embeddings[i], k=5, include_scores=True)            search_time = (time.time() - start_time) * 1000            print(f"搜索耗时: {search_time:.2f}ms")            print("最相关文档:")for j, (doc_idx, score) in enumerate(zip(results, scores)):                print(f"  {j+1}. 文档 #{doc_idx} (相似度: {score:.3f})")# 运行测试    asyncio.run(test_search())if __name__ == "__main__":    main()

如何选择适合你的配置?

准确度优先模式(optimization_level="accuracy")

适用场景:

  • 法律合规要求100%召回率
  • 文档数量较少(<10万)
  • 研究性应用,每个结果都至关重要

配置:

  • 使用完整维度(1792维)
  • 精确搜索(无索引)
  • 多线程并行

平衡模式(optimization_level="balanced")

适用场景:

  • 生产环境法律搜索工具
  • 需要接近完美的结果(>95%召回率)
  • 能接受几秒钟的索引构建时间

配置:

  • 使用完整维度
  • HNSW索引(连接数32)
  • 推荐用于大多数法律应用

速度优先模式(optimization_level="speed")

适用场景:

  • 面向消费者的应用
  • 内存受限环境(<200MB)
  • RAG系统中的第一轮快速检索
  • 需要处理数千并发用户

配置:

  • 256维裁剪
  • 半精度存储(f16)
  • HNSW索引
  • 最高查询速度

写在最后

  1. 服务条款很重要:处理敏感数据前,务必阅读嵌入API的服务条款
  2. 维度裁剪很有效:Isaacus嵌入的前256维保留了大部分语义信息
  3. CPU也能很快:USearch通过SIMD优化在CPU上实现毫秒级检索
  4. 权衡是必要的:在速度、内存和准确度之间找到适合你用例的平衡点

对于法律搜索应用,我推荐平衡模式——993 q/s的速度加上98.6%的召回率,既能提供优秀的用户体验,又能保证检索质量。

但如果你在构建RAG系统,需要快速筛选出前50-100个相关文档供后续处理,那么速度优先模式的2,880 q/s吞吐量将带来质的飞跃。

记住:一个能在0.35ms内返回61%相关结果的系统,往往比需要19ms才能返回100%结果的系统更有用——特别是在多级处理管道中。

现在,你已经拥有了构建高性能法律文档搜索系统所需的所有工具和知识。从选择合适的嵌入提供商开始,到实施维度裁剪和USearch优化,每一步都可以根据你的具体需求进行调整。

你在实际项目中是如何处理大规模文档检索的?有没有遇到过特别棘手的问题?欢迎在评论区分享你的经验和想法!

参考资料
[1] 

USearch GitHub仓库: https://github.com/unum-cloud/USearch

[2] 

Isaacus文档: https://docs.isaacus.com/

[3] 

Open Australian Legal Corpus: https://github.com/justinpombrio/open-australian-legal-corpus

[4] 

MLEB法律检索基准: https://isaacus.com/mleb

长按或扫描下方二维码,免费获取 Python公开课和大佬打包整理的几百G的学习资料,内容包含但不限于Python电子书、教程、项目接单、源码等等

推荐阅读

Python 3.15 在 Windows x86-64 上的解释器有望提速 15%

Python Fabric库:轻松实现远程自动化管理

别再浪费内存了:Python __slots__ 机制深入解析

不仅仅是 Try/Except:资深 Python 工程师的错误处理工程化实践

点击 阅读原文 了解更多

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-09 05:43:55 HTTP/2.0 GET : https://f.mffb.com.cn/a/459859.html
  2. 运行时间 : 0.139500s [ 吞吐率:7.17req/s ] 内存消耗:4,975.28kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=dd68fe1524bbb6598814fe2c576a0765
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.001043s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001514s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000694s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000740s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001369s ]
  6. SELECT * FROM `set` [ RunTime:0.000595s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001502s ]
  8. SELECT * FROM `article` WHERE `id` = 459859 LIMIT 1 [ RunTime:0.000983s ]
  9. UPDATE `article` SET `lasttime` = 1770587035 WHERE `id` = 459859 [ RunTime:0.018680s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000584s ]
  11. SELECT * FROM `article` WHERE `id` < 459859 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.010806s ]
  12. SELECT * FROM `article` WHERE `id` > 459859 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.001107s ]
  13. SELECT * FROM `article` WHERE `id` < 459859 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.003708s ]
  14. SELECT * FROM `article` WHERE `id` < 459859 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.003204s ]
  15. SELECT * FROM `article` WHERE `id` < 459859 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.004638s ]
0.143305s