It's all about the answers!

Ask a question

oslc.searchTerms is not working as expected


jyoti mishra (45148) | asked Jun 02 '22, 6:05 a.m.
retagged Jun 06 '22, 9:46 a.m. by Ian Barnard (2.3k714)

 Hello Everyone,


For Searching Test Case/Test Plan by its ID or Title with Wild Card, I have used oslc.searchTerms in the query, but it's behaviour is not consistent. It is working fine in most of the projects, but it is failing in the projects ,which is having more data(2744).I am not sure about the reason, why it is failing for this project. One of the reason could be large data. I have used the below query-

Method:-Post
Header:-Accept:application/rdf+xml
OSLC-Core-Version:2.0
Content-type:application/x-www-form-urlencoded
Query URL:-
https://<server>:<port>/qm/oslc_qm/contexts/<ProjectUUID>/resources/com.ibm.rqm.planning.VersionedTestCase
Body:-
oslc.searchTerms=%222*%22&oslc.select=dcterms%3Atitle,oslc%3AshortId,dcterms%3Aidentifier,dcterms%3Amodified&oslc_config.context=<ConfigUUID>
Authorization:- Bearer token

After running the above query, it is returning only 43 data, but if we search the same (2<asterisk Symbol>) in the application of QM Search box   ,it is listing 100 data. I thought, this might be returning data from only first page, so thought to apply pagination, but in the response 'oslc:totalCount' is 43 only. and 'oslc:nextPage' is also not available.

Can you please guide me ,what could be the issue.

Thanks and Regards,
Jyoti


Comments
Ian Barnard commented Jun 06 '22, 12:37 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
 I'm not sure oslc.searchTerms works exactly like the quicksearch in the user interface. In the OSLC Query specification there's no reference to using wildcards in oslc.searchTerms. Do you get the expected number of results when you use a whole word (i.e. without a wildcard) as a search term? In the OSLC Query spec there are references to using pattern matching within XMLLiteral and xsd:string comparisons, but note this is optional, and isn't obviously relevant to oslc.searchTerms whjich doesn't mention either of those types of values - this pattern matching uses % to match any length of string and _ for any single of character, i.e. this is different from the quick search in the user interface. You may be best to create a support case.

One answer



permanent link
Ralph Schoon (63.7k33648) | answered Jun 03 '22, 8:23 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 As far as I can find, the specification https://docs.oasis-open.org/oslc-core/oslc-query/v3.0/csprd01/oslc-query-v3.0-csprd01.html does not mention to send the search terms in the body at all, the search terms are in the URI.


The method GET is also valid and would not even send a request body.


Comments
Ian Barnard commented Jun 06 '22, 4:09 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I believe you can use POST and put the query parameters in the body as Jyoti has done.


David Honey commented Jun 06 '22, 5:29 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Servers should support POST with a URL form encoded body that represents similar parameters to a GET. It's there in the OSLC query spec.


Ralph Schoon commented Jun 07 '22, 1:50 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Interesting. I missed that. Thanks for sharing. 

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.