du7535 2015-10-09 15:02
浏览 112

Solr过滤器查询字符串

I have been working with Solr recently to filter data using set_filter_query. I was able to work with Integer values.

$solr_dao->set_filter_query('ID:[3+TO+*]');

This query filters data having values 3 or more. I am also trying to include a word search on a field using

$solr_dao->set_filter_query('Comments:[*'.$search_term.'*]');

which doesn't seem to be working. This query should filter data with comments field having the search term. Any ideas what might cause this?

  • 写回答

1条回答 默认 最新

  • duanli0453 2015-10-09 15:11
    关注

    use this instead :

    $solr_dao->set_filter_query('Comments:*'.$search_term.'*');
    

    Note that in Solr, it indexes every words. So if a row contains "Hello honey my name is John" in the column "foo", if your query is foo:Hello World, this row will satisfy the query, since Solr looks for words, and read spaces as "OR"...

    评论

报告相同问题?

悬赏问题

  • ¥15 路易威登官网 里边的参数逆向
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程
  • ¥20 模型在y分布之外的数据上预测能力不好如何解决
  • ¥15 processing提取音乐节奏
  • ¥15 gg加速器加速游戏时,提示不是x86架构
  • ¥15 python按要求编写程序
  • ¥15 Python输入字符串转化为列表排序具体见图,严格按照输入
  • ¥20 XP系统在重新启动后进不去桌面,一直黑屏。
  • ¥15 opencv图像处理,需要四个处理结果图