Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.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
Performance 在SOLR(Lucene)中,按id查询是否比其他查询更快?_Performance_Solr_Lucene_Full Text Search - Fatal编程技术网

Performance 在SOLR(Lucene)中,按id查询是否比其他查询更快?

Performance 在SOLR(Lucene)中,按id查询是否比其他查询更快?,performance,solr,lucene,full-text-search,Performance,Solr,Lucene,Full Text Search,Id是主键,另一个_字段是字符串字段 http://localhost:8983/solr/select?q=id:c2c32773-1691-11df-97a5-7038c432aabf http://localhost:8983/solr/select?q=another_field:c2c32773-1691-11df-97a5-7038c432aabf 第一个查询是否更快?对id的查询不会使其比任何其他查询更快,除非字段是文本字段,根据所执行的分析,这会花费更长的时间。 另外,如果您想

Id是主键,另一个_字段是字符串字段

http://localhost:8983/solr/select?q=id:c2c32773-1691-11df-97a5-7038c432aabf
http://localhost:8983/solr/select?q=another_field:c2c32773-1691-11df-97a5-7038c432aabf

第一个查询是否更快?

对id的查询不会使其比任何其他查询更快,除非字段是文本字段,根据所执行的分析,这会花费更长的时间。
另外,如果您想更好地使用过滤器查询Id或固定值字段,由于字段缓存的原因,过滤器查询会更快