MarkLogic Cookbook

Book Description

Learn how to get the most out of MarkLogic with recipes from people who understand this powerful multi-model database platform from the inside out. MarkLogic comes with a broad set of capabilities to help you quickly integrate data from silos, but it takes time to learn how to harness that power. In this three-part series, key members of the MarkLogic team—including engineers who built the database—provide targeted recipes to get you up to speed.

In Part 1, you’ll learn how to solve real-world problems with XQuery, the functional language for working with hierarchical data structures such as XML. Part 2 helps you solve common search-related problems with recipes that work with MarkLogic 9 as well as with older versions. With recipes in Part 3, you’ll explore the multiple ways MarkLogic represents data.

  • XQuery: Gain XQuery peak performance, and explore its use in maps, documents, document security, the task server, and administration
  • Search-related problems: Conduct document searches, score search results, understand how data is used, and search with the Optic API
  • MarkLogic and data: Work with input transformations, tokenization, template-driven extraction, and redaction

Table of Contents

  1. Foreword
  2. Preface
    1. Acknowledgments
  3. I. Implementing XQuery: Practical Solutions to Real-World Problems
  4. 1. Peak Performance
    1. Assert Query Mode
      1. Problem
      2. Solution
      3. Discussion
    2. Fast Distinct Values
      1. Problem
      2. Solution
      3. Discussion
  5. 2. Fun with Maps
    1. Check Whether Two Maps Are Equal
      1. Problem
      2. Solution
      3. Discussion
    2. Find the Intersection of a Sequence of Maps
      1. Problem
      2. Solution
      3. Discussion
    3. Apply a Function to All Values in a Map
      1. Problem
      2. Solution
      3. Discussion
  6. 3. Document Security
    1. List User Permissions on a Document
      1. Problem
      2. Solution
      3. Discussion
    2. Get Permissions with Role Names
      1. Problem
      2. Solution
      3. Discussion
  7. 4. Working with Documents
    1. Generate a Unique ID
      1. Problem
      2. Solution
      3. Discussion
    2. Find Binary Documents
      1. Problem
      2. Solution
      3. Discussion
    3. Find Recently Modified Binary Documents
      1. Problem
      2. Solution
      3. Discussion
  8. 5. The Task Server
    1. Cancel Active Tasks on the Task Server
      1. Problem
      2. Solution
      3. Discussion
    2. Cancel Active and Queued Tasks on the Task Server
      1. Problem
      2. Solution
      3. Discussion
  9. 6. Administration
    1. Find Hostnames in a Cluster
      1. Problem
      2. Solution
      3. Discussion
    2. Find Current and Effective MarkLogic Versions During Rolling Upgrade
      1. Problem
      2. Solution
      3. Discussion
  10. II. Documents, Triples, and Values: Powering Search
  11. 7. Document Searches
    1. Search by Root Element
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    2. Find Documents That Are Missing an Element
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
  12. 8. Scoring Search Results
    1. Sort Results to Promote Recent Documents
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    2. Weigh Matches Based on Document Parts
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
  13. 9. Understanding Your Data and How It Gets Used
    1. Logging Search Requests
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    2. Count Documents in Directories
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
  14. 10. Searching with the Optic API
    1. Paging Over Results
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    2. Group By
      1. Solution
      2. Discussion
      3. See Also
    3. Extract Content from Retrieved Documents
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    4. Select Documents Based on Criteria in Joined Documents
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
  15. III. Transforming Data
  16. 11. Input Transformations
    1. Changing Date Format
      1. Problem
      2. Solution
      3. Discussion
    2. Converting Binaries to Base64 Strings and Back
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    3. Ingesting an Aggregate JSON File with Many Documents Inside
      1. Problem
      2. Solution
      3. Discussion
  17. 12. Tokenization
    1. Tokenizing Social Security Numbers
      1. Problem
      2. Solution
      3. Discussion
  18. 13. Template-Driven Extraction
    1. Searching on Derived Data
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    2. Using an IRI Namespace with TDE
      1. Problem
      2. Discussion
      3. See Also
  19. 14. Redaction
    1. Redacting Credit Card Numbers, Replacing with Digits
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    2. Redacting ICD10 Codes
      1. Problem
      2. Solution
      3. Discussion

Product Information

  • Title: MarkLogic Cookbook
  • Author(s): Dave Cassel
  • Release date: March 2018
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781491994603