• <legend id='QssOV'><style id='QssOV'><dir id='QssOV'><q id='QssOV'></q></dir></style></legend>
    • <bdo id='QssOV'></bdo><ul id='QssOV'></ul>

    1. <i id='QssOV'><tr id='QssOV'><dt id='QssOV'><q id='QssOV'><span id='QssOV'><b id='QssOV'><form id='QssOV'><ins id='QssOV'></ins><ul id='QssOV'></ul><sub id='QssOV'></sub></form><legend id='QssOV'></legend><bdo id='QssOV'><pre id='QssOV'><center id='QssOV'></center></pre></bdo></b><th id='QssOV'></th></span></q></dt></tr></i><div id='QssOV'><tfoot id='QssOV'></tfoot><dl id='QssOV'><fieldset id='QssOV'></fieldset></dl></div>
    2. <small id='QssOV'></small><noframes id='QssOV'>

      <tfoot id='QssOV'></tfoot>

        在使用 Lucene 进行搜索时,我们能否在 templateId 中分配多个模板 ID(就像我们在 relatedId

        Can we assign more then one template ID in templateId (like we do in relatedId), while searching with Lucene?(在使用 Lucene 进行搜索时,我们能否在 templateId 中分配多个模板 ID(就像我们在 relatedId 中所做的那样)?) - IT屋-程序员软件开发技术分
            <bdo id='ajLZd'></bdo><ul id='ajLZd'></ul>
          • <tfoot id='ajLZd'></tfoot>
            <legend id='ajLZd'><style id='ajLZd'><dir id='ajLZd'><q id='ajLZd'></q></dir></style></legend>
              1. <i id='ajLZd'><tr id='ajLZd'><dt id='ajLZd'><q id='ajLZd'><span id='ajLZd'><b id='ajLZd'><form id='ajLZd'><ins id='ajLZd'></ins><ul id='ajLZd'></ul><sub id='ajLZd'></sub></form><legend id='ajLZd'></legend><bdo id='ajLZd'><pre id='ajLZd'><center id='ajLZd'></center></pre></bdo></b><th id='ajLZd'></th></span></q></dt></tr></i><div id='ajLZd'><tfoot id='ajLZd'></tfoot><dl id='ajLZd'><fieldset id='ajLZd'></fieldset></dl></div>

                <small id='ajLZd'></small><noframes id='ajLZd'>

                  <tbody id='ajLZd'></tbody>

                  本文介绍了在使用 Lucene 进行搜索时,我们能否在 templateId 中分配多个模板 ID(就像我们在 relatedId 中所做的那样)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有五个复选框

                  • 搜索全部
                  • 模板 1
                  • 模板 2
                  • 模板 3
                  • 模板 4

                  如果用户选择 Search All,那么我们可以简单地传递索引名称并获取结果,如果用户选择模板特定复选框之一,我们同样可以通过传递模板名称来完成,但如果有的话两个模板特定的复选框(或者可能是三个)被选中,然后?

                  If user selects Search All, then simply we can pass index name and get result, if user selects one of template specific check box, again simply we can do by passing template name, but if any of two templates specific check box(or may be three) are checked, then?

                  我们可以用管道分隔模板ID吗?

                  Can we pipe-separate templateIDs?

                  推荐答案

                  您可能需要更改 Advanced Database Crawler 中的方法来处理传入的模板的 GUID.SearchParam 类有一个名为 TemplateIds 的属性是复数表示它应该允许多个.但是,如果您查看代码,这就是它的使用方式:

                  You may need to change the method in the Advanced Database Crawler to handle the GUIDs of templates passed in. The SearchParam class has a property called TemplateIds which by being plural indicates it should allow more than one. However, if you look into the code, this is how it is used:

                  templateIds = IdHelper.NormalizeGuid(templateIds);
                  

                  NormalizeGuid() 方法实际上是 只返回一个 GUID.所以我建议您在这里更改 ApplyTemplateFilter() 方法以返回多个模板 GUID:

                  The NormalizeGuid() method actually only returns a single GUID. So I recommend you alter the ApplyTemplateFilter() method here to return multiple Template GUIDs:

                  protected void ApplyTemplateFilter(CombinedQuery query, string templateIds, QueryOccurance occurance)
                  {
                    if (String.IsNullOrEmpty(templateIds)) return;
                  
                    templateIds = IdHelper.NormalizeGuid(templateIds);
                    var fieldQuery = new FieldQuery(BuiltinFields.Template, templateIds);
                    query.Add(fieldQuery, occurance);
                  }
                  

                  所以更改 templateIds = IdHelper.NormalizeGuid(templateIds) 以处理多个 GUID,也许通过在 | 处拆分输入以获取每个 GUID,然后对其中的每一个进行规范化并通过 | 再次组合它们.

                  So change templateIds = IdHelper.NormalizeGuid(templateIds) to handle multiple GUIDs, perhaps by splitting the input at a | to get each GUID then normalizing each one of those and combining them again via a |.

                  这篇关于在使用 Lucene 进行搜索时,我们能否在 templateId 中分配多个模板 ID(就像我们在 relatedId 中所做的那样)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  C# namespace alias - what#39;s the point?(C# 命名空间别名 - 有什么意义?)
                  Using Xpath With Default Namespace in C#(在 C# 中使用具有默认命名空间的 Xpath)
                  Generating an EDMX from a DB2 Database(从 DB2 数据库生成 EDMX)
                  IBM .NET Data Provider Connection String issue with Library List(库列表的 IBM .NET 数据提供程序连接字符串问题)
                  .NET DB2 OLEDB pre-requisites(.NET DB2 OLEDB 先决条件)
                  Referring to Code in IBM.Data.DB2 makes that Assembly Unavailable to the rest of my Solution(引用 IBM.Data.DB2 中的代码使该程序集对我的解决方案的其余部分不可用)

                    1. <legend id='Wba2d'><style id='Wba2d'><dir id='Wba2d'><q id='Wba2d'></q></dir></style></legend>
                      <i id='Wba2d'><tr id='Wba2d'><dt id='Wba2d'><q id='Wba2d'><span id='Wba2d'><b id='Wba2d'><form id='Wba2d'><ins id='Wba2d'></ins><ul id='Wba2d'></ul><sub id='Wba2d'></sub></form><legend id='Wba2d'></legend><bdo id='Wba2d'><pre id='Wba2d'><center id='Wba2d'></center></pre></bdo></b><th id='Wba2d'></th></span></q></dt></tr></i><div id='Wba2d'><tfoot id='Wba2d'></tfoot><dl id='Wba2d'><fieldset id='Wba2d'></fieldset></dl></div>

                      <small id='Wba2d'></small><noframes id='Wba2d'>

                          <tbody id='Wba2d'></tbody>
                        <tfoot id='Wba2d'></tfoot>

                            <bdo id='Wba2d'></bdo><ul id='Wba2d'></ul>