4

I am going by Marklogic Tutorial for Oscars to develop an application for my documents that I have ingested in the database. What I am not able to understand is that though the Search box performs autocomplete, but it doesnot do that for elements..i.e if I type Cha...then it should start suggesting all names starting with Cha..sucha as Charles, Charley etc.Sample Oscars Application

As shown in figure: I can write Decade(which will get autocompleted..) and select one among 1920s..1930s..etc. But I dont want to specify Field name as such.I just want to type actor name and it should provide auto suggest on that...

I have looked for it in the documentation where it says that search:suggest function can do this; but I am new to xquery etc and dont know how to proceed...

Do I need to modify this function or add something to it?How?

4

1 回答 1

3

如果您输入全文搜索词,则自动完成功能会处理全文索引中的单词和短语。如果您在搜索字段关键字前面添加,则自动完成限制在此范围内。

我不知道搜索字段关键字的名称,但我猜它们是奖项:、十年:和获奖者:。所以,如果你输入十年:,那么自动完成应该只提供十年。

- 编辑 -

根据您的评论,如果您没有指定特定的搜索字段,听起来您想更改自动完成的来源。这很容易。如果您启动向导以创建Oscar 示例应用程序,则该选项位于第一个屏幕上。您还可以在创建后从Application Builder重新访问同一向导以应用更改。

只需打开该向导,转到“搜索”步骤,然后查找“高级设置”按钮。在覆盖屏幕的中间应该有一个名为“建议”的标题,并在下拉列表下方指定默认来源,这是当您不为搜索词添加前缀时自动完成的来源。如果您希望不带前缀的术语针对演员姓名自动完成,请将其更改为“名称”。

于 2013-09-30T12:43:16.260 回答