dpnof28482 2010-11-24 20:13
浏览 126

如何使用solr php客户端使用多值字段进行有效的分面搜索?

I'm attempting to setup a faceted search for my website, but am running into problems.

The facet fields are setup as dynamic multiValued fields. Though most of the products only have one value for each faceted field (designated as fq_* where the * is the attributeid of the product attribute being stored), some have multiple values.

Faceted search was working great - nice and fast until I tried accessing a category of our products where 1 or more of the products had multiple values on a faceted attribute. For this category (and others like it) I get an error from the php solr client: "500" Status: Internal Server Error.

After searching for a while I found that setting facet.method equal to "enum" that it solved the error - however this increased the amount of time it took to load the page dramatically.

Is there any way to do a faceted search like this with more efficiency? (I can handle it taking a little longer than the "fc" method, but not much).

Thanks.

Edit (here are the parameters):

$solr->search('categoryid:4810', 0, 15, array(8) {
  ["sort"]=>
  string(17) "price_Default asc"
  ["facet"]=>
  string(4) "true"
  ["facet.field"]=>
  array(12) {
    [0]=>
    string(7) "mfgname"
    [1]=>
    string(14) "fq_33111116587"
    [2]=>
    string(14) "fq_33111116586"
    [3]=>
    string(14) "fq_33111114704"
    [4]=>
    string(11) "fq_33113118"
    [5]=>
    string(9) "fq_331472"
    [6]=>
    string(10) "fq_3312052"
    [7]=>
    string(9) "fq_331611"
    [8]=>
    string(10) "fq_3312304"
    [9]=>
    string(14) "fq_33111116919"
    [10]=>
    string(9) "fq_331100"
    [11]=>
    string(9) "fq_331710"
  }
  ["facet.sort"]=>
  string(5) "false"
  ["facet.mincount"]=>
  int(1)
  ["facet.missing"]=>
  string(5) "false"
  ["facet.limit"]=>
  int(-1)
  ["facet.method"]=>
  string(4) "enum"
}
);
  • 写回答

1条回答 默认 最新

  • drudfe0446838 2011-03-29 19:07
    关注

    You are probably running into memory problems not of Solr, but of Tomcat... Solr's faceting takes a lot of memory and Tomcat's usual setup comes with a very low memory setup, increase the memory of your JAVA_OPTS:

    (linux) export JAVA_OPTS="-Xmx3500m -Xms3500m"

    or some other appropriate value to the amount of info you handle and your server has available.

    Here are some good resources on this: http://wiki.apache.org/tomcat/FAQ/Memory http://helpdeskgeek.com/how-to/increase-tomcat-memory-allocation/

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度