上个月,我创建了一个为全文搜索编制索引的视图,我可以在Louts客户端和网页上执行。
直到今天,我测试了Web应用程序中的所有功能,我注意到全文搜索无法正常工作。
创建视图和搜索功能后,我没有"触摸"那段时间,所以我认为它应该工作。但是在Web应用程序中,当我执行搜索功能时,视图不会显示任何结果。然后我在Lotus客户端中搜索,它显示"在视图中找到的结果与搜索匹配。"。
我开始发现问题,我通常在函数完成时创建数据库备份。因此,我使用最新的备份数据库,看看全文搜索是否有效。
我觉得很奇怪,备份数据库中的搜索功能在Web应用程序和Lotus客户端中运行良好。
在当前数据库中,我删除索引并再次创建它,它无法搜索。即使我要求我的同事重新启动服务器(因为我不是管理员),全文搜索也无法正常工作。我问我的同事服务器中是否有任何日志文件用于诊断。我的同事给了我一个日志文件,该日志文件于2016年6月30日开始于" xpages_ex_servername_date@time.log" ;,他说这是最新的日志文件,7月没有日志文件。
我没有任何想法来解决这个问题。
这是我用来测试在Lotus客户端中搜索的代码:
FIELD dateYYYYMM >=201601 & FIELD dateYYYYMM <= 201612
所有代码在备份数据库中都能正常工作,但当前数据库甚至无法从备份数据库中整个设计工作并粘贴到当前数据库,全文搜索无法正常工作。
有什么办法可以解决这个问题吗?请感谢您的建议。谢谢。
更新:我删除了以前版本中的一些内容,并在下面添加新信息以供您咨询。
在xpage中,有一个供用户搜索的表格
<xp:table style="width:1100.0px" id="criteriaTable">
<xp:tr><xp:td><xp:label value="ID" id="label2"></xp:label> </xp:td>
<xp:td style="width:200.0px">
<xp:comboBox id="idField" style="width:200.0px" dojoType="dijit.form.ComboBox" value="#{sessionScope.idSearch}">
<xp:selectItems>
<xp:this.value><![CDATA[#{javascript:var SetFirstValueBlank = @Text("");
return SetFirstValueBlank;
}]]></xp:this.value>
</xp:selectItems>
<xp:selectItems>
<xp:this.value><![CDATA[# {javascript:@DbColumn(@DbName(),"staffinfo",1);
}]]></xp:this.value>
</xp:selectItems>
<xp:eventHandler event="onchange" submit="true" refreshMode="partial" refreshId="criteriaTable"></xp:eventHandler></xp:comboBox>
</xp:td>
<xp:td style="width:597.0px">
   </xp:td>
</xp:tr>
<xp:tr>
<xp:td style="width:174.0px"><xp:label value="Department" id="label1"></xp:label></xp:td>
<xp:td style="width:200.0px">
<xp:comboBox id="departmentField" style="width:200.0px" dojoType="dijit.form.ComboBox" value="#{sessionScope.departSearch}">
<xp:selectItems>
<xp:this.value><![CDATA[#{javascript:var SetFirstValueBlank = @Text("");
return SetFirstValueBlank;
}]]></xp:this.value>
</xp:selectItems>
<xp:selectItems>
<xp:this.value><![CDATA[#{javascript://get id
var getValue = getComponent("idField").getValue();
//lookup in staffinfo view
@DbLookup(@DbName(),"staffinfo",getValue,2);
}]]></xp:this.value>
</xp:selectItems>
</xp:comboBox></xp:td>
<xp:td style="width:597.0px"></xp:td>
</xp:tr>
<xp:tr>
<xp:td><xp:label value="Name" id="label3"></xp:label> </xp:td>
<xp:td style="width:200.0px">
<xp:comboBox id="nameField" style="width:200.0px" dojoType="dijit.form.ComboBox" value="#{sessionScope.nameSearch}">
<xp:selectItems>
<xp:this.value><![CDATA[#{javascript:var SetFirstValueBlank = @Text("");
return SetFirstValueBlank;}]]></xp:this.value>
</xp:selectItems>
<xp:selectItems>
<xp:this.value><![CDATA[#{javascript://get id
var getValue = getComponent("idField").getValue();
//lookup in staffinfo view
@DbLookup(@DbName(),"staffinfo",getValue,3);}]]></xp:this.value>
</xp:selectItems>
</xp:comboBox></xp:td>
<xp:td style="width:597.0px"></xp:td>
</xp:tr>
<xp:tr>
<xp:td style="width:149.0px">
<xp:label value="Start Year and Month for search" id="label28">
</xp:label>
<xp:br></xp:br>
<xp:label value="yyyymm" id="label29"></xp:label> </xp:td>
<xp:td style="width:200.0px">
<xp:inputText id="inputText1" value="# {sessionScope.startDateSearch}" style="width:200.0px">
</xp:inputText></xp:td>
<xp:td style="width:597.0px">
</xp:td>
</xp:tr>
<xp:tr>
<xp:td style="width:149.0px">
<xp:label value="End Year and Month for search" id="label31">
</xp:label>
<xp:br></xp:br>
<xp:label value="yyyymm" id="label32"></xp:label> </xp:td><xp:td style="width:200.0px">
<xp:inputText id="inputText2" value="# {sessionScope.endDateSearch}" style="width:200.0px"></xp:inputText></xp:td>
<xp:td style="width:597.0px">
</xp:td>
</xp:tr>
<xp:tr>
<xp:td style="width:149.0px"></xp:td>
<xp:td style="width:200.0px">
</xp:td>
<xp:td style="width:597.0px">
</xp:td>
</xp:tr>
<xp:tr>
<xp:td style="width:149.0px">
<xp:button value="Clear Selection" id="button1">
<xp:eventHandler event="onclick"
submit="true" refreshMode="complete" immediate="false"
save="false" id="eventHandler2">
<xp:this.action><![CDATA[# {javascript:sessionScope.divisionSearch = "";
sessionScope.rankSearch = ""
sessionScope.postSearch = "";
sessionScope.officerNameSearch = ""
sessionScope.startDateSearch = "";
sessionScope.endDateSearch = ""
}]]></xp:this.action>
</xp:eventHandler>
</xp:button>
<xp:br></xp:br></xp:td>
<xp:td style="width:200.0px">
<xp:button value="Execute" id="button2">
<xp:eventHandler event="onclick" submit="true" refreshMode="complete">
</xp:eventHandler></xp:button>
<xp:br></xp:br>
<xp:br></xp:br><xp:text escape="true" id="computedField2" rendered="false"><xp:this.value><![CDATA[#{javascript://use to check the query in text format
var qstring= "";
if ((sessionScope.idSearch != null && sessionScope.idSearch != "" )||
(sessionScope.departSearch != null && sessionScope.departSearch != "")&&
(sessionScope.nameSearch != null && sessionScope.nameSearch != "")||
(sessionScope.startDateSearch != null && sessionScope.startDateSearch != "")||
(sessionScope.endDateSearch != null && sessionScope.endDateSearch !=""))
{
qstring = "FIELD id contains \"*" + sessionScope.idSearch + "*\"" +
" | FIELD department contains \"*" + sessionScope.departSearch + "*\"" +
" | FIELD name contains \"*" + sessionScope.nameSearch + "*\"" +
" & FIELD dateYYYYMM >=" + sessionScope.startDateSearch +
" & FIELD dateYYYYMM <=" + sessionScope.endDateSearch;
}
return qstring;
}]]></xp:this.value></xp:text></xp:td>
<xp:td style="width:597.0px">
<xp:text escape="true" id="computedField1" value="# {sessionScope.queryString}">
</xp:text>
</xp:td>
</xp:tr>
</xp:table>
视图是显示搜索结果。
<xp:viewPanel rows="30" id="viewPanel2" viewStyle="width:600.0px">
<xp:this.data>
<xp:dominoView var="view1" viewName="staffallocation"
expandLevel="4">
<xp:this.search><![CDATA[#{javascript:var qstring= "";
if ((sessionScope.idSearch != null && sessionScope.idSearch != "" )||
(sessionScope.departSearch != null && sessionScope.departSearch != "")&&
(sessionScope.nameSearch != null && sessionScope.nameSearch != "")||
(sessionScope.startDateSearch != null && sessionScope.startDateSearch != "")||
(sessionScope.endDateSearch != null && sessionScope.endDateSearch !=""))
{
qstring = "FIELD id contains \"*" + sessionScope.idSearch + "*\"" +
" | FIELD department contains \"*" + sessionScope.departSearch + "*\"" +
" | FIELD name contains \"*" + sessionScope.nameSearch + "*\"" +
" & FIELD dateYYYYMM >=" + sessionScope.startDateSearch +
" & FIELD dateYYYYMM <=" + sessionScope.endDateSearch;
}
return qstring;}]]></xp:this.search>
</xp:dominoView>
</xp:this.data>
<xp:viewColumn columnName="name" id="viewColumn4">
<xp:viewColumnHeader value="Officer"
id="viewColumnHeader4">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="allocationDate" id="viewColumn5">
<xp:viewColumnHeader value="Allocation Date"
id="viewColumnHeader5">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="department" id="viewColumn6">
<xp:viewColumnHeader value="Allocated Department"
id="viewColumnHeader6">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:this.facets>
<xp:pager partialRefresh="true" layout="Previous Group Next"
xp:key="footerPager" id="pager3">
</xp:pager>
</xp:this.facets>
</xp:viewPanel>
代码说明:组合框用于搜索人员ID或部门或员工姓名。用户需要使用YYYYMM格式键入开始日期和结束日期。单击按钮时,视图将显示结果取决于条件。结果将显示官员姓名,官员分配日期和分配的分配。
答案 0 :(得分:3)
使用Notes客户端视图搜索选项,选择这些字段以构建搜索条件。不要只是复制和粘贴您的搜索条件,因为这不会为您提供所需的信息。检查每个字段提供正确的选项 - id,department和name给出“contains”/“不包含”,dateYYYYMM提供“等于”/“小于”等(假设它应该是一个数字字段)。
如果在数据库中使用相同的字段名称和不同的数据类型,或者更改了字段的数据类型,则会影响全文搜索。搜索设置保存在UNK表中,该表保存特定字段名称与其数据类型之间的映射。因此,dateYYYYMM字段名称必须在所有表单和数据库中的所有文档中保持一致。否则,创建的第一个文档的数据类型将存储并用于所有全文查询。恢复设计无效 - 它是第一个创建的文档,它是在UNK表中存储数据类型的关键。
有关更多信息,请参阅http://www.intec.co.uk/full-text-search-musings/,并通过更新所有文档和使用离线契约来解决问题。
答案 1 :(得分:1)
两个建议。
将字符串记录在 qstring 中,以便您可以将其拾取并将其粘贴到Notes客户端的搜索栏中。
我认为当你执行搜索时,Notes会抱怨它不能使用&lt; =或=&gt;关于文本值。这些运算符仅定义“仅用于数字或日期字段中的数字或日期”。请参阅“如何使用运算符优化搜索查询?”在Notes帮助数据库中。因此,您必须以不同方式构建搜索字符串或参数。