简体   繁体   English

coldfusion cfsearch不适用于关键字吸烟

[英]coldfusion cfsearch is not working for keyword smoking

I have Four files[One .PDF, one .doc and Two .docx]. 我有四个文件[一个.PDF,一个.doc和两个.docx]。 I have created one ColdFusion collections named "testCollection" using ColdFusion Administrator. 我已经使用ColdFusion Administrator创建了一个名为“ testCollection”的 ColdFusion集合。 In Manage ColdFusion Collection screen i entered File Extensions [.pdf, .doc, .docx] and the directory path where the all 4 files are placed. 在“管理ColdFusion集合”屏幕中,我输入了文件扩展名[.pdf,.doc,.docx]和放置所有4个文件的目录路径。 Also checked the checkbox [Recursively Index Sub Directories]. 还选中了[递归索引子目录]复选框。 Once i click submit i can see 5 documents with their size in Solr Collections. 单击提交后,我可以在Solr集合中看到5个文档及其大小。

After that i wrote below one cfm file to search file on the basis of their content. 之后,我在下面写了一个cfm文件来根据其内容搜索文件。
Search.cfm Search.cfm

<cfcollection action="list" name="AllSolrCollections" engine="solr">
    <!--- Filter to the collection that this application uses. --->
     <cfquery name="chkSolrCollection" dbtype="query">
          select * from AllSolrCollections 
         where AllSolrCollections.name = 'testCollection'
      </cfquery>
    <cftry>
      <cfif chkSolrCollection.recordcount EQ 1>                 
          <cfsearch name="mySearch" collection="testcollection" criteria="Aged" startrow=1>
    </cfif>
  <cfcatch type="SearchEngine">
    <cfoutput>Error</cfoutput>                    
 </cfcatch>
 </cftry>
  <cfdump var="#mySearch#">

When i entered criteria "Aged" it is giving me the correct result and showing all files except one file "Search_Not_Show_For_Aged.docx" since it has no search criteria content "Aged". 当我输入标准“老化”时,它会给我正确的结果并显示除一个文件“ Search_Not_Show_For_Aged.docx”以外的所有文件,因为它没有搜索标准内容“老化”。

My issue is When i entered criteria "smoking" , it is not giving me the correct result. 我的问题是,当我输入标准“吸烟”时 ,它没有给我正确的结果。 it shows all files except one file "Search_Not_Show_For_Smoking.docx" but this files contains "smoking" word. 它显示除一个文件“ Search_Not_Show_For_吸烟.docx”以外的所有文件,但此文件包含“吸烟”字样。 I put my files in dropbox and share here 我将文件放入保管箱并在此处共享

Please suggest and help to solve this issue. 请提出建议并帮助解决此问题。

Thanks 谢谢

If we do optimize the collection, the searching will work. 如果我们确实优化了集合,搜索将起作用。 We can Optimize Collection using coldfusion administration or using coldfusion code. 我们可以使用ColdFusion管理或使用ColdFusion代码来优化Collection。

To Optimize collection using coldfusion administration: 要使用Coldfusion管理优化收集,请执行以下操作:

  1. Login to /cfide/administartor/index.cfm 登录到/cfide/administartor/index.cfm
  2. Data & Services > Coldfusion Collections 数据与服务> Coldfusion馆藏
  3. Click optimize icon in Actions section for each collection. 单击每个集合的“操作”部分中的“优化”图标。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM