We are using Solr on Windows with multiple collections. Collections are having multiple stored and indexed fields with appx 200k documents. The use case is for e-commerce website search. The size of index is appx. 200 MB
While the normal search takes less than few ms, the query where I need to find all data for multiple categories are taking somewhere around 1100ms to 1200ms. The query includes appx. 400 categories with OR something like..
Category:(5 OR 33 OR 312 OR 1192 OR 1193 OR 1196 OR .....)
I have increased Heap Size to 4gb, and configured Solr cache value to be on higher size, this reduced the query time from 2000ms to 1100ms, but we are looking for more improvement.
I also found following on Solr UI: lockFactory=org.apache.lucene.store.NativeFSLockFactory@56761b2a; maxCacheMB=48.0 maxMergeSizeMB=4.0
But not sure does that impact? And if Yes, how to change that? Can you advise what else we can do? Let me know if you need more details.
Thank you in anticipation.
答案 0 :(得分:2)
您应该添加完整的请求,以便更容易提供一些建议。但是,从你的句子“查询包括appx.400类别与OR之类的东西......”我明白你把你的巨大条款放在q param中?这不是正确的方法。
而是使用q = *:*并将您的子句放在fq中。这样,它将被缓存,后续查询将更快。如果您获得了良好的缓存命中率,查询速度会明显加快。
作为第二件事,你可以尝试(但首先使用上述内容)可以将大OR子句转换为范围子句的一个(或组合),如下所示:
Category:[5 TO 1190] OR Category:[1192 TO 1196]
如果你的类型是一个色调,你可以通过显着减小它的大小将该子句转换为范围组合,它也可以工作