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/

    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器