【问题标题】:Is There a way to use Zend Search Lucene in a way similar to Useing the WHERE LIKE sql in Databases?有没有办法以类似于在数据库中使用 WHERE LIKE sql 的方式使用 Zend Search Lucene?
【发布时间】:2010-07-16 13:22:17
【问题描述】:
$select = $this->_db->select()->from($this->_name,array("id","fullname","username","email"))->where("fullname LIKE '$query%'");

我目前正在使用这个 SQL 语句来支持我的 Ajax 自动建议,如果我输入“a”,它会得到以 a 开头的结果。

我想知道这是否可以通过使用 Zend Lucene 索引来完成。

【问题讨论】:

    标签: php mysql zend-framework lucene zend-search-lucene


    【解决方案1】:

    您的第一站应该是 Zend Framework 参考手册,更具体地说: http://framework.zend.com/manual/en/zend.search.lucene.query-language.html

    因此,您可以使用 * 进行通配符搜索,就像在 SQL 中使用 % 一样(即,当您提供单词的一部分时)。

    【讨论】:

    • 太棒了!工作...非常感谢
    猜你喜欢
    • 1970-01-01
    • 2011-08-14
    • 1970-01-01
    • 2022-11-25
    • 1970-01-01
    • 1970-01-01
    • 2023-03-07
    • 1970-01-01
    • 2021-10-19
    相关资源
    最近更新 更多