Reputation: 1048
How to search within a text file(.txt) with search:search API in Marklogic. I want to upload a txt file to Marklogic and use search:search API to search its contents. How can I do it ?
Upvotes: 0
Views: 216
Reputation: 2961
search:search() should be able to find hits in text documents.
xdmp:document-insert("/text.txt", text { "Hello World " } )
Then
search:search("Hello")
Should return a hit. (Yes, text documents are represented as documents with an XML text node at the root).
Upvotes: 2