dpjr86761 2015-09-23 09:17
浏览 965

query_string不适用于ElasticSearch中的大写字符串

'query' => array(
                    'query_string' => array(
                        'fields'=> array('name'),
                        "analyze_wildcard" => true,
                        'query' => '*tom*'
                    )
                )

I use this query phrase in php program,and It match lowercase strings, eg: tom/test/1 , but 'Tom/test/2' is not matched, I tried 'query' => 'Tom' also not worked. Any suggestions? Thanks a lot.

  • 写回答

1条回答 默认 最新

  • dswwuo1223 2015-09-23 09:21
    关注

    How about changing the line

    'query' => '*tom*'
    

    to

    strtolower('query') => strtolower('*tom*')
    

    I've not tested that - so it may not work, but in theory, set both sides of the equation to lowercase and it should ignore case.

    评论

报告相同问题?

悬赏问题

  • ¥15 shape_predictor_68_face_landmarks.dat
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制