简体   繁体   English

MarkLogic搜索:search()不搜索特定的TEI元素

[英]MarkLogic search:search() not searching a specific TEI element

I have a MarkLogic database containing TEI XML documents. 我有一个包含TEI XML文档的MarkLogic数据库。 I built an application to search and display these documents. 我构建了一个应用程序来搜索和显示这些文档。 During testing, we found that certain keywords were not being found when searched and narrowed down the problem to realize that the keywords that weren't being found are in the following element: 在测试过程中,我们发现在搜索时找不到某些关键字并缩小问题范围,以便意识到未找到的关键字位于以下元素中:

<foreign xml:lang="lat">unio cum ipso</foreign>

Searching for the latin phrase "unio cum ipso" returns zero results. 搜索拉丁短语“unio cum ipso”会返回零结果。 I'm thinking it has something to do with the @xml:lang, but I'm wondering if anyone has encountered a similar problem and how they solved it. 我认为它与@xml:lang有关,但我想知道是否有人遇到类似问题以及他们是如何解决的。 Thanks! 谢谢!

If you are doing a stemmed search (the default) it will be language sensitive and will use the default language from the database unless specified otherwise. 如果您正在执行词干搜索(默认),它将是语言敏感的,并将使用数据库中的默认语言,除非另有说明。 If you want to do a cross-language search, use the unstemmed option. 如果要进行跨语言搜索,请使用unstemmed选项。

Thanks to @mholstege and @Wagner Michael I was able to solve this. 感谢@mholstege和@Wagner Michael我能够解决这个问题。 The problem was that we were using @xml:lang to specify multiple languages without having a MarkLogic license key for anything but the default English. 问题是我们使用@xml:lang来指定多种语言而没有MarkLogic许可证密钥,除了默认的英语之外的其他任何东西。 Marklogic treats any @xml:lang values as a generic language if you don't have the appropriate license key, so any keyword searches in the database for these non-English terms won't return any matches. 如果您没有相应的许可证密钥,Marklogic会将任何@xml:lang值视为通用语言,因此在数据库中搜索这些非英语术语的任何关键字都不会返回任何匹配项。

See Marklogic's Search Developer's Guide, Ch. 请参阅Marklogic的搜索开发人员指南,Ch。 28 for a better explanation than I can give. 28比我能给出更好的解释。 :) :)

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

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