【发布时间】:2011-07-01 08:52:46
【问题描述】:
我一直在尝试通过 ColdFusion 9 从数据库结果集中在 Apache Solr 中创建一个集合。我想在 SQL 中进行如下搜索:
select * from events where eventName like 'Meet%'
在 SQL 中,这将部分匹配一个单词并返回该行。我正在尝试使用 Solr 集合和 CF 中的 <cfsearch> 来执行此操作,如下所示:
<cfsearch collection="#myCollection#" criteria="Meet*" name="results" />
但是,除非我指定了完整的单词,否则我不会取回数据,尽管使用了通配符。 docs 表示在搜索开始时不允许使用通配符,但在搜索结束时并未表示不允许使用通配符。事实上对我来说它在任何地方都不起作用!
<!--- No results -->
<cfsearch collection="#myCollection#" criteria="Meet*" name="results" />
<!--- No results -->
<cfsearch collection="#myCollection#" criteria="Meet*g" name="results" />
<!--- No results -->
<cfsearch collection="#myCollection#" criteria="Meeti?g" name="results" />
<!--- Yes - results! -->
<cfsearch collection="#myCollection#" criteria="Meeting" name="results" />
是否有人使用<cfsearch> 实现了通配符 Solr 搜索?如果是这样,你能指出我正确的方向吗?
【问题讨论】:
标签: coldfusion lucene full-text-search solr