Re: [MarkLogic Dev General] function index in MarkLogic?

2015-01-08 Thread Michael Blakeley
Specifying a collation at the app-server doesn't fully solve the problem. If a collation is the right tool for the job, it needs to be part of the index and again as part of the query. It's important to understand the difference between specifying a collation in a range index, in a FLWOR

Re: [MarkLogic Dev General] function index in MarkLogic?

2015-01-08 Thread Paul Hoehne
So one reason to do this, in the example given, is that (hypothetically) a city field in an address might have: HOUSTON, houston, Houston, HOuston, etc. Rather than using a computed field, you would use a case insensitive, maybe whitespace and punctuation insensitive index, so NEW YORK NEW

Re: [MarkLogic Dev General] function index in MarkLogic?

2015-01-08 Thread Alexei Betin
So is there a way to create such case, whitespace and punctuation insensitive index? I tried using http://marklogic.com/collation/S1 as Geert suggested and that worked as far as capitalization goes (but it does not work e.g. for whitespace – ‘Houston ‘ would still be a miss). In addition, I

[MarkLogic Dev General] How to get all result in single hit through REST API

2015-01-08 Thread Thangella.VinodReddy
Hi, Mark Logic search REST API by default returns 10 records per hit. We know that there is an attribute called pageLength to return the no of results to which it is set. But we want to return all documents from MarkLogic database without knowing its count. It's not recommended to get all

Re: [MarkLogic Dev General] function index in MarkLogic?

2015-01-08 Thread Danny Sokolsky
If you look in the Admin Interface on the screens where you create range indexes, there is a collation builder there. That can help you. Using the collation builder, it looks like this will be case and diacritic insensitive as well as space insensitive:

Re: [MarkLogic Dev General] MarkLogic Geospatial indexing strategy for XML representation of GeoJSON

2015-01-08 Thread Geert Josten
Small addition to this: MarkLogic 8 will be able to index GeoJSON as-is. MarkLogic 8 allows storing JSON as JSON type documents, and then you can put a geospatial path index on location-point/coordinates. I was able to run the following successfully on MarkLogic 8, and get the JSON document

Re: [MarkLogic Dev General] XDMP:http-get and 304 responses

2015-01-08 Thread Geert Josten
Hi Chris, Does the response contain a Content-Length? If not, maybe MarkLogic waits the full timeout before it decides there is none. If it has one (with a value of zero), that might be a bug.. Kind regards, Geert From: Chris Hudson-Silver

[MarkLogic Dev General] XDMP:http-get and 304 responses

2015-01-08 Thread Chris Hudson-Silver
Hi All, Recently I was working on a project that tracks a repository by calling a REST webservice that returns back metadata and download URLS for items that have changed in the remote repository since the last call. It then checks to see if the item has already been downloaded and if so will

Re: [MarkLogic Dev General] XDMP:http-get and 304 responses

2015-01-08 Thread Chris Hudson-Silver
Hi Gert, Thanks for your reply. I checked and the response did not have a content-length so I checked the HTTP spec to see what the content-length should be set to for a 304 response. The 304 response MUST NOT contain a message-body:

Re: [MarkLogic Dev General] What about XQuery proper?

2015-01-08 Thread Joe Wicentowski
Hi Gary, Very interesting response - thanks! Just one note: For the XQuery update facilities and is still a candidate recommendation, I believe the XQuery Update Facility is already a full recommendation: http://www.w3.org/TR/xquery-update-10/ Joe

Re: [MarkLogic Dev General] XQuery results through REST

2015-01-08 Thread Erik Hennum
Hi, Gilles: You could create a REST API resource service extension that supports the POST method, accepting a document with the XQuery code, evaluating the XQuery code, and returning an XML document. Either the user will need the eval privilege or you'll need to add an amp to a role with the

[MarkLogic Dev General] What about XQuery proper?

2015-01-08 Thread Gary Vidal
/attachments/20150108/3657ae29/attachment-0001.html -- Message: 2 Date: Thu, 8 Jan 2015 10:43:33 + From: Geert Josten geert.jos...@marklogic.com Subject: Re: [MarkLogic Dev General] XDMP:http-get and 304 responses To: MarkLogic Developer Discussion general

[MarkLogic Dev General] XQuery results through REST

2015-01-08 Thread Gilles Lenfant
Hi, I need to execute XQuery from a REST client app and retrieve results as XML documents. I made a similar thing easily using exit-db back-end but I'm somehow stuck to find the best practice with ML 7 to code the same thing. The pseudo-code (Python like) I made looks like this : --- #

Re: [MarkLogic Dev General] XDMP:http-get and 304 responses

2015-01-08 Thread Geert Josten
Hi Chris, It is not uncommon to be strict in sending, tolerant in receiving with such things. I would recommend sending your case to Support. The delay sounds unnecessary, and inconvenient.. Kind regards, Geert From: Chris Hudson-Silver

Re: [MarkLogic Dev General] XDMP:http-get and 304 responses

2015-01-08 Thread David Ennis
Although not an ideal solution, but if it does end up being a bug that you have to live with for now, then perhaps one way that will help with the delay for the time being at the expense of extra round-trips: - first do a head request using hdmp:http-head() - locally decide on the need to

[MarkLogic Dev General] function index in MarkLogic?

2015-01-08 Thread Alexei Betin
Hello, Does MarkLogic has something similar to function index as exists in other databases such as Oracle? For example, in Oracle one can create a function index on a value of UPPER(field_name) as follows: CREATE INDEX cities_fn_idx ON cities (UPPER(name)); which ensures that a query like the

Re: [MarkLogic Dev General] function index in MarkLogic?

2015-01-08 Thread Geert Josten
Hi Alexei, On the question whether MarkLogic allows indexing function results, then the answer is unfortunately no. Such a feature is on the wish list of many of us. The best alternative for upper-case would be using collations to ignore case, for instance http://marklogic.com/collation//S1

Re: [MarkLogic Dev General] function index in MarkLogic?

2015-01-08 Thread Justin Makeig
As Geert indicates, there is no exactly comparable functionality in MarkLogic today. You can think of the document—structure and values—as the API to the indexes. Thus, if you want to index something it needs to be (mostly) explicit in the document itself. (Word stemming is a counter example of

Re: [MarkLogic Dev General] function index in MarkLogic?

2015-01-08 Thread David Ennis
To expand on those answers by Justin and Geert: I've played with this challenge a bit about a year ago and come to an interesting solution that worked well enough for my needs: - set up a trigger on update or insert - analyze the doc to see if it matches your function (the code you are using,