Endeca在多个字段上的搜索查询 [英] Endeca search query on multiple fields
问题描述
如何在多个字段的组合上创建Endeca查询[就像sql查询中的where子句一样].假设我们索引的三个字段是-
How to create an Endeca query on combination of multiple fields [just like where clause in sql query]. Suppose we have three fields indexed are -
- empId
- empName
- empGender
现在,我需要一个查询,例如其中的empName如's%'和empGender = male"
Now, I need a query like "where empName like 's%' AND empGender=male"
谢谢.
推荐答案
首先,
结帐Record Filters
>.
如果尝试在属性上使用Record Filter
,则需要在Developer Studio中为该属性显式启用它,而Dimensions会自动具有应用Record Filter
的能力.当您有明确的值要过滤时,例如empGender
.
If you are trying to use a Record Filter
on a property, you will need to enable it explicitly in Developer Studio for that property, while your Dimensions will automatically have the ability to apply a Record Filter
. This will help when you have explicit values to filter on, for example empGender
.
您的Record Filter
然后可以如下所示:
Your Record Filter
can then look as follow:
Nr=AND(empGender:male)
您可以进一步使用Ntk
参数指定要搜索的字段,因此,假设您的empName字段已启用通配符搜索(在Developer Studio中进行配置),则搜索该字段将如下所示:
You can further use the Ntk
parameter to specify fields to search on so assuming your empName field is enabled for wildcard searching (configure this in Developer Studio) searching this field will look as follow:
Ntk=empName&Ntt=s*
因此,假设您的属性已正确配置,则上面的示例可能最终看起来如下:
So assuming your properties have been configured correctly, your example above will probably end up looking as follow:
Nr=AND(empGender:male)&Ntk=empName&Ntt=s*
要更进一步,可以一起指定Search Filters
(即Ntk
+ Ntt
参数).我没有为通配符尝试过此操作,因此您需要确认自己,但要结合使用Search Filters
并用|
To take this one step further, you can specify Search Filters
(ie. Ntk
+ Ntt
parameters) together. I haven't tried this for wildcards so you'll need to confirm that yourself but to combine Search Filters
you delimit them with |
Ntk=empName|empId&Ntt=s*|1234*
我建议您在参考应用程序中手动建立查询,以确认您获得了预期的结果,然后开始在应用程序中对此进行编码.
I suggest you manually build up queries in the Reference Application to confirm you get your expected results and then start to code this up in your application.
这篇关于Endeca在多个字段上的搜索查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!