Questions tagged [cts-search]

cts-search refers to a set of MarkLogic functions related to low-level search

is an enterprise NoSQL database with multiple methods available to search content.

One of them is the set of cts:search related functions. These include query constructors, geospatial functions, geospatial lexicon functions, lexicon functions, math lexicon (aggregation) functions, clustering, temporal functions, and core cts search functions.

The cts-search capability is contrasted with higher-level search libraries such as the Search API as well as the search capabilities of the REST API, the Java Client API, and the Node Client API.

28 questions
5
votes
3 answers

MarkLogic: binding cts:search expression to a variable

In MarkLogic, is it possible to bind a cts:search expression to a variable and then use that variable elsewhere in the XQuery? I want to do something like this: let $query := cts:search(doc(), cts:and-query(( …
cascavel
  • 191
  • 1
  • 7
3
votes
1 answer

How to preserve relevance order of cts:search results

I have the following codes: 1) for $song in cts:search(fn:doc(), "night") return $song/ts:top-song/ts:title/text() 2) cts:search(fn:doc(), "night")/ts:top-song/ts:title/text() cts:search returns documents as per the relevance. Both the codes,…
Yash
  • 510
  • 2
  • 6
  • 14
3
votes
1 answer

Checking absence of attribute with cts:query

I have an XML fragment where I want to have different queries based in the existence of the id attribute:
Loren Cahlander
  • 1,257
  • 1
  • 10
  • 24
2
votes
2 answers

Is Marklogic search with position possible?

There is some explanation of a use case below; the actual question follows. I am using ML search queries on some documents that contain elements of the form: Jim ...
Alexey
  • 21
  • 2
2
votes
1 answer

Issue using cts:not-query or cts:and-not-query

My MarkLogic version is 9. I have 2 queries returning expected results when run separately but when I try to combine them I get no result. My data looks like below, I need to match only ABC, not ABC/* (or ABC/D if this is the searched criteria and…
Fred A.
  • 31
  • 3
2
votes
1 answer

Converting the logic for cts:search to search:search

I have been working with cts:search in my project but somehow it feels the result time are taking a bit longer than expected. Can search:search help? If so, how? For example I have the query as let $query :=…
2
votes
1 answer

MarkLogic: how to search for an XPath using cts:uris

Is it possible to search for a uri whose document contains a certain XPath using cts:uris()? I thought it may be quicker than returning uris from a cts:search. Here is what I have currently: declare function local:xpath-search($collection) { for…
cascavel
  • 191
  • 1
  • 7
2
votes
1 answer

Marklogic Diacritic Sensitive search not working for unfiltered searches

If I do a diacritic sensitive cts:query for cts:search in unfiltered mode then I get correct result but doing the same in filtered mode gives me incorrect results. For example…
majin
  • 576
  • 1
  • 5
  • 14
2
votes
1 answer

Marklogic count old documents using cts:search over FLWOR

Question on using cts:search over FLOWR. I have a xqy that runs over all docs in the database and checks an element that has a timestamp. We created that timestamp on insertion of the doc. Goal is to delete documents older then x days. Now I need to…
Hugo Koopmans
  • 1,349
  • 1
  • 15
  • 27
2
votes
1 answer

Moving where into cts:search

Given this query: for $d in cts:search( fn:doc(), cts:and-query( ( cts:collection-query(('InProgress_Audit')) ) )) where not(fn:contains($d//TitleDate/text(),"Z")) return…
Ben Aston
  • 53,718
  • 65
  • 205
  • 331
1
vote
0 answers

MarkLogic - lexicon expansion not working as expected

I'm trying to address the issue of excessive incorrect results from an unfiltered search with a wildcard. In my understanding, the right way to fix it is to use "lexicon expansion." However, when I look at the documentation for…
1
vote
1 answer

Option "wildcarded" for "jsonPropertyValueQuery" ctsquery causes the different results called via REST API or in Marklogic Query Console

We have local instance of Marklogic recently downloaded from docker hub with the following bash command: docker run --name marklogic-test -d -it -p 8000:8000 -p 8001:8001 -p 8002:8002 \ -e MARKLOGIC_INIT=true \ -e MARKLOGIC_ADMIN_USERNAME=admin \ …
Nadia
  • 99
  • 6
1
vote
1 answer

Marklogic Perfomance impact on where to place the string replacement in Optics query or TDE

It is about searching XML content in MarkLogic. One of the fields has some double quote characters inside, which causes a problem for CSV export. It is decided to change the double quote to a single quote. I used TDE with Optics API to perform the…
1
vote
1 answer

Combining multiple MarkLogic queries with cts:search

I am trying to query a database of documents in MarkLogic to find any that fit several parameters: This MUST be true A list of authors must contain an author ID provided And EITHER of these must be true: A list of extra-documents must have a…
OstrichGlue
  • 325
  • 1
  • 4
  • 13
1
vote
1 answer

Parsed query contains no qtextpre in ML9

I've inherited code that was ported from ML7 to ML9 last year and the facet pane of a search page does not display a facet clear control like it did in the legacy system. The XQuery logic to build the control depends on the result of search:parse()…
Paulwms
  • 95
  • 8
1
2