Re: [MarkLogic Dev General] How to use uri-match in the java api?

2017-04-03 Thread Andreas Hubmer
Hi Erik,

Thanks for your response.

Performance should not be an issue because we are using trailing wildcards.
So all index matches are consecutive.

Regards,
Andreas


2017-04-03 20:58 GMT+02:00 Erik Hennum :

> Hi, Andreas:
>
> The REST API doesn't support the cts:*-match() functions out of the box.
>
> If you really need to match values in a range index, you can implement a
> resource service extension that takes the appropriate parameters and makes
> the call.
>
> To perform well at scale for a range index with many values (such as the
> uri lexicon), you might think about passing in or constructing a
> constraining query so the comparison is only on some values instead of all
> values in the range index.
>
>
> Erik Hennum
>
>
> --
> *From:* general-boun...@developer.marklogic.com [
> general-boun...@developer.marklogic.com] on behalf of Andreas Hubmer [
> andreas.hub...@ebcont.com]
> *Sent:* Monday, April 03, 2017 1:09 AM
> *To:* MarkLogic Developer Discussion
> *Subject:* Re: [MarkLogic Dev General] How to use uri-match in the java
> api?
>
> Hi,
>
> Using queryManager.values I can invoke cts:uris, but how could I invoke
> cts:uri-match with a wildcarded uri through the Java API?
>
> Thanks,
> Andreas
>
>
>
> 2017-03-31 17:22 GMT+02:00 Justin Makeig :
>
>> Apologies, I read too fast. You were asking about "Java", not
>> "JavaScript". (Car is to carpet as Java is to JavaScript.)
>>
>> You'll need to specify a URI values constraint.
>>
>> http://marklogic.com/appservices/search";>
>> 
>> 
>> 
>>   …
>> 
>>
>> And then queryManager.values("uris", new JacksonHandle()) to use it. (Hat
>> tip: Sam Mefford.)
>>
>> Take a look at <http://docs.marklogic.com/guide/java/searches#id_76144>
>> and <http://docs.marklogic.com/guide/search-dev/appendixa#id_46397>.
>>
>> Justin
>>
>> > On Mar 31, 2017, at 8:08 AM, Justin Makeig 
>> wrote:
>> >
>> > <https://docs.marklogic.com/cts.uriMatch>
>> >
>> > In general, the built-in functions map one-to-one between JavaScript
>> and XQuery. (There are exceptions.) Because hyphens aren't friendly in
>> JavaScript property names, we do a kabab-case to camel-case translation for
>> all of the names in JavaScript, i.e. cts:uri-match() in XQuery is
>> cts.uriMatch() in JavaScript.
>> >
>> > Justin
>> >
>> >> On Mar 31, 2017, at 3:31 AM, Andreas Felix 
>> wrote:
>> >>
>> >> Hi,
>> >> i need to fetch uris by wildcard, eg. foo*
>> >> In xquery i use the cts:uri-match function for this.
>> >> Does anybody know how so solve this with the Java-API?
>> >>
>> >> Regards
>> >> Andreas
>> >> ___
>>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] How to use uri-match in the java api?

2017-04-03 Thread Erik Hennum
Hi, Andreas:

The REST API doesn't support the cts:*-match() functions out of the box.

If you really need to match values in a range index, you can implement a 
resource service extension that takes the appropriate parameters and makes the 
call.

To perform well at scale for a range index with many values (such as the uri 
lexicon), you might think about passing in or constructing a constraining query 
so the comparison is only on some values instead of all values in the range 
index.


Erik Hennum



From: general-boun...@developer.marklogic.com 
[general-boun...@developer.marklogic.com] on behalf of Andreas Hubmer 
[andreas.hub...@ebcont.com]
Sent: Monday, April 03, 2017 1:09 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] How to use uri-match in the java api?

Hi,

Using queryManager.values I can invoke cts:uris, but how could I invoke 
cts:uri-match with a wildcarded uri through the Java API?

Thanks,
Andreas



2017-03-31 17:22 GMT+02:00 Justin Makeig 
mailto:justin.mak...@marklogic.com>>:
Apologies, I read too fast. You were asking about "Java", not "JavaScript". 
(Car is to carpet as Java is to JavaScript.)

You'll need to specify a URI values constraint.

http://marklogic.com/appservices/search";>



  …


And then queryManager.values("uris", new JacksonHandle()) to use it. (Hat tip: 
Sam Mefford.)

Take a look at <http://docs.marklogic.com/guide/java/searches#id_76144> and 
<http://docs.marklogic.com/guide/search-dev/appendixa#id_46397>.

Justin

> On Mar 31, 2017, at 8:08 AM, Justin Makeig 
> mailto:justin.mak...@marklogic.com>> wrote:
>
> <https://docs.marklogic.com/cts.uriMatch>
>
> In general, the built-in functions map one-to-one between JavaScript and 
> XQuery. (There are exceptions.) Because hyphens aren't friendly in JavaScript 
> property names, we do a kabab-case to camel-case translation for all of the 
> names in JavaScript, i.e. cts:uri-match() in XQuery is cts.uriMatch() in 
> JavaScript.
>
> Justin
>
>> On Mar 31, 2017, at 3:31 AM, Andreas Felix 
>> mailto:andreas.fe...@ebcont.com>> wrote:
>>
>> Hi,
>> i need to fetch uris by wildcard, eg. foo*
>> In xquery i use the cts:uri-match function for this.
>> Does anybody know how so solve this with the Java-API?
>>
>> Regards
>> Andreas
>> ___

___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] How to use uri-match in the java api?

2017-04-03 Thread Andreas Hubmer
Hi,

Using queryManager.values I can invoke cts:uris, but how could I invoke
cts:uri-match with a wildcarded uri through the Java API?

Thanks,
Andreas



2017-03-31 17:22 GMT+02:00 Justin Makeig :

> Apologies, I read too fast. You were asking about "Java", not
> "JavaScript". (Car is to carpet as Java is to JavaScript.)
>
> You'll need to specify a URI values constraint.
>
> http://marklogic.com/appservices/search";>
> 
> 
> 
>   …
> 
>
> And then queryManager.values("uris", new JacksonHandle()) to use it. (Hat
> tip: Sam Mefford.)
>
> Take a look at 
> and .
>
> Justin
>
> > On Mar 31, 2017, at 8:08 AM, Justin Makeig 
> wrote:
> >
> > 
> >
> > In general, the built-in functions map one-to-one between JavaScript and
> XQuery. (There are exceptions.) Because hyphens aren't friendly in
> JavaScript property names, we do a kabab-case to camel-case translation for
> all of the names in JavaScript, i.e. cts:uri-match() in XQuery is
> cts.uriMatch() in JavaScript.
> >
> > Justin
> >
> >> On Mar 31, 2017, at 3:31 AM, Andreas Felix 
> wrote:
> >>
> >> Hi,
> >> i need to fetch uris by wildcard, eg. foo*
> >> In xquery i use the cts:uri-match function for this.
> >> Does anybody know how so solve this with the Java-API?
> >>
> >> Regards
> >> Andreas
> >> ___
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] How to use uri-match in the java api?

2017-03-31 Thread Justin Makeig
Apologies, I read too fast. You were asking about "Java", not "JavaScript". 
(Car is to carpet as Java is to JavaScript.)

You'll need to specify a URI values constraint. 

http://marklogic.com/appservices/search";>
  

  
  …


And then queryManager.values("uris", new JacksonHandle()) to use it. (Hat tip: 
Sam Mefford.)

Take a look at  and 
.

Justin

> On Mar 31, 2017, at 8:08 AM, Justin Makeig  
> wrote:
> 
> 
> 
> In general, the built-in functions map one-to-one between JavaScript and 
> XQuery. (There are exceptions.) Because hyphens aren't friendly in JavaScript 
> property names, we do a kabab-case to camel-case translation for all of the 
> names in JavaScript, i.e. cts:uri-match() in XQuery is cts.uriMatch() in 
> JavaScript.
> 
> Justin
> 
>> On Mar 31, 2017, at 3:31 AM, Andreas Felix  wrote:
>> 
>> Hi,
>> i need to fetch uris by wildcard, eg. foo*
>> In xquery i use the cts:uri-match function for this.
>> Does anybody know how so solve this with the Java-API?
>> 
>> Regards
>> Andreas
>> ___
>> General mailing list
>> General@developer.marklogic.com
>> Manage your subscription at: 
>> http://developer.marklogic.com/mailman/listinfo/general
> 
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at: 
> http://developer.marklogic.com/mailman/listinfo/general

___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] How to use uri-match in the java api?

2017-03-31 Thread Justin Makeig


In general, the built-in functions map one-to-one between JavaScript and 
XQuery. (There are exceptions.) Because hyphens aren't friendly in JavaScript 
property names, we do a kabab-case to camel-case translation for all of the 
names in JavaScript, i.e. cts:uri-match() in XQuery is cts.uriMatch() in 
JavaScript.

Justin

> On Mar 31, 2017, at 3:31 AM, Andreas Felix  wrote:
> 
> Hi,
> i need to fetch uris by wildcard, eg. foo*
> In xquery i use the cts:uri-match function for this.
> Does anybody know how so solve this with the Java-API?
> 
> Regards
> Andreas
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at: 
> http://developer.marklogic.com/mailman/listinfo/general

___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general