Escaping ~ from restful metadata search

Do you want to create a native client or integrate with third party applications: webservices are the solution.
Forum rules
Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
Post Reply
dhabcert
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: Fri Feb 08, 2019 6:57 am

Escaping ~ from restful metadata search

Post by dhabcert » Fri Feb 08, 2019 8:42 am

We are currently setting up an Openkm 6.3.3 CE server and are filling it with our documents and metadata.
One of our metadata fields contain a ~ searching for metadata contained in other fields not containing a ~ work fine.
But all tries to escape the ~ from the search failed. We currently tried the following combinations:

Code: Select all

http://localhost:8080/OpenKM/services/rest/search/find?property=okp:document.name=Value\~Containing&domain=1
http://localhost:8080/OpenKM/services/rest/search/find?property=okp:document.name=Value\\~Containing&domain=1
http://localhost:8080/OpenKM/services/rest/search/find?property=okp:document.name=Value\\\\~Containing&domain=1
http://localhost:8080/OpenKM/services/rest/search/find?property=okp:document.name="Value~Containing"&domain=1
http://localhost:8080/OpenKM/services/rest/search/find?property=okp:document.name='Value~Containing'&domain=1
http://localhost:8080/OpenKM/services/rest/search/find?property=okp:document.name="Value\~Containing"&domain=1
http://localhost:8080/OpenKM/services/rest/search/find?property=okp:document.name="Value\\~Containing"&domain=1
For the trial requests we used Postman, all requests are GET with the corresponding Authorization headers and Accept application/json.
Does anyone know what i could possibly change to get this to work?

jllort
Moderator
Moderator
Posts: 10451
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Escaping ~ from restful metadata search

Post by jllort » Sat Feb 09, 2019 11:36 am

You should encode the value

dhabcert
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: Fri Feb 08, 2019 6:57 am

Re: Escaping ~ from restful metadata search

Post by dhabcert » Mon Feb 11, 2019 7:24 am

Thanks for the advice, but sadly it didn't work. We had to remove all ~ from the metadata and from the given searches to make it work.

jllort
Moderator
Moderator
Posts: 10451
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Escaping ~ from restful metadata search

Post by jllort » Wed Feb 13, 2019 7:11 pm

Probably the character " should not be set in the url. An the word value it does not seems a real value "Value\\~Containing"

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests