Skip to main content

What's New in MarkLogic 11

JSON with Non-default Language Now Reindexed Properly

MarkLogic 11 contains a fix for a bug that caused JSON documents with non-default language properties to be reindexed incorrectly.

In versions prior to MarkLogic 11, incorrect search results may be returned after a reindex of JSON documents with the "lang" or "language" property set to a language other than the database's default language setting and stemming is enabled for the database.

For example, the following document, when inserted in a database with stemming enabled, would be indexed in the specified language--in this case, "fr" (French) even if the default database language is not set to the document's language:

{
 "lang": "fr",
 "type": "bonjour"
}

 A query with a specified matching language--in this case "fr"--will match this document:

cts:search(fn:doc(),cts:json-property-value-query("type", "bonjour","lang=fr")) 

However, upon reindexing, if the default database language is not set to "fr", documents with a language property other than the default language, as in the example, will no longer match a query with a non-default language. For example, after reindexing occurs, the following query would stop matching the example document:

cts:search(fn:doc(),cts:json-property-value-query("type", "bonjour","lang=fr")) 

However, this query, which used the default database language, would incorrectly match the example document:

cts:search(fn:doc(),cts:json-property-value-query("type", "bonjour"))

After upgrading to MarkLogic 11, if there are JSON documents with non-default language properties in databases with stemming enabled, you will not notice a change in behavior unless a reindex is triggered either manually or by a change in the index configuration. If a reindex is performed, queries that were not working correctly before, i.e. queries that should have been matching documents with non-default language properties, will now work correctly, and there may be additional matching documents.