Pavan
Pavan

Reputation: 17

MarkLogic search in a particular file

I am using below.

QueryManager queryMgr = dbClient.newQueryManager();     
StringQueryDefinition query = queryMgr.newStringDefinition();       
// Some text eg. "test"
query.setCriteria(criteria);        
SearchHandle resultsHandle = new SearchHandle();        
queryMgr.search(query, resultsHandle);

this does the search in all the docs.

How I can reuse this to make the search in a particular file?

Upvotes: 0

Views: 39

Answers (1)

Sam Mefford
Sam Mefford

Reputation: 2475

I'm not sure why you'd search a particular file. But if you want to, try StructuredQueryBuilder.document. Here's docs on using StructuredQueryBuilder: 1, 2.

Upvotes: 1

Related Questions