【发布时间】:2016-10-30 13:58:32
【问题描述】:
我正在使用 Solr 处理对大量文档的搜索,我开始遇到带有构面和过滤器的复杂查询的性能问题。 这是一个用于获取一些数据的 solr 查询:
solr 完整请求:http://host/solr/discovery/select?q=&fq=domain%3Acom+OR+host%3Acom+OR+public_suffix%3Acom&fq=crawl_date%3A%5B2000-01-01T00%3A00%3A00Z+TO+2000-12 -31T23%3A59%3A59Z%5D&fq=%7B%21tag%3Dcrawl_year%7Dcrawl_year%3A%282000%29&fq=%7B%21tag%3Dpublic_suffix%7Dpublic_suffix%3A%28com%29&start=0&rows=10&sort=score+desc&fl=%2Cscore&hl=true&hl.fragsize=200&hl.simple.pre=%3Cstrong%3E&hl.simple.post=%3C%2Fstrong%3E&hl.sn-ps=10&hl.fl=content&hl.mergeContiguous=false&hl.maxAnalyzedChars=100000&hl.usePhraseHighlighter= true&facet=true&facet.mincount=1&facet.limit=11&facet.field=%7B%21ex%3Dcrawl_year%7Dcrawl_year&facet.field=%7B%21ex%3Ddomain%7Ddomain&facet.field=%7B%21ex%3Dpublic_suffix%7Dpublic_suffix&facet.field=%7B% 21ex%3Dcontent_language%7Dcontent_language&facet.field=%7B%21ex%3Dcontent_type_norm%7Dcontent_type_norm&shards=shard1"
当这个查询在本地使用大约 50000 个文档时,大约需要 10 秒,但是当我在拥有 2 亿个文档的主机上尝试它时,大约需要 4 分钟。我自然知道在主机中需要更长的时间,但我想知道是否有人遇到同样的问题并且能够获得更快的结果。知道我正在使用两个 Shard。
等待您的回复。
【问题讨论】:
-
什么版本的 Solr?您可能想查看Solr sparse faceting,它是为与您的查询表明您正在使用的内容非常相似而创建的。