Ticket #241 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Add support app_id / coll_id seach in CQL

Reported by: robert Owned by: robert
Priority: major Milestone: MediaMosa 2.1
Component: CQL Version: 2.1
Keywords: Cc:
MoSCoW: Must Have Estimated time after impact analysis:
Related to project: none Tested: yes
Accepted: yes Estimated Hours:

Description

Enable search on app_id and coll_id in CQL.

The app_id search is used for global master admins. This was needed for searching within the apps the global master admin has access to.

The coll_id is now used as parameter in asset search only, outside CQL.

Change History

Changed 3 years ago by robert

  • status changed from new to closed
  • resolution set to ready_for_review

Changed 3 years ago by robert

  • component changed from Core to CQL

Changed 3 years ago by Michiel.Schok

  • status changed from closed to reopened
  • resolution ready_for_review deleted

Where can we find up-to-date documentation about CQL-possibilities ?

When using the app_id, an error 500 occurs

/asset?cql=(app_id=5)

<?xml version="1.0" encoding="UTF-8"?>
<response>
  <header>
    <item_count>0</item_count>
    <item_count_total>0</item_count_total>
    <item_offset>0</item_offset>
    <request_matched_method>GET</request_matched_method>
    <request_matched_uri>/asset</request_matched_uri>
    <request_process_time>0.0654</request_process_time>
    <request_result>error</request_result>
    <request_result_description>PDOException caught; SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%5%) AND 
(((((a.app_id IN(5))) OR ((a.app_id = 3) AND 
aut_ms.app_id_master IN(' at line 3,
trace; #0 /var/opt/www/vpcore/htdocs/includes/database/database.inc(1735): PDOStatement-&gt;execute(Array)
#1 /var/opt/www/vpcore/htdocs/includes/database/database.inc(568): DatabaseStatementBase-&gt;execute(Array, Array)
#2 /var/opt/www/vpcore/htdocs/includes/database/database.inc(1821): DatabaseConnection-&gt;query('SELECT SQL_CALC...', Array, Array)
#3 [internal function]: db_query('SELECT SQL_CALC...', Array, Array)
#4 /var/opt/www/vpcore/htdocs/sites/all/modules/mediamosa/lib/mediamosa_db.inc(151): call_user_func_array('db_query', Array)

When using the coll_id parameter, unrealistic amount of assets are returned (this is the 'Academia Totaal' collection with 20k+ assets

<?xml version="1.0" encoding="UTF-8"?>
<response>
  <header>
    <item_count>0</item_count>
    <item_count_total>0</item_count_total>
    <item_offset>0</item_offset>
    <request_matched_method>GET</request_matched_method>
    <request_matched_uri>/asset</request_matched_uri>
    <request_process_time>0.0898</request_process_time>
    <request_result>success</request_result>
    <request_result_description>The query returned an empty result set (i.e. zero rows).</request_result_description>
    <request_result_id>705</request_result_id>
    <request_uri>[GET] /asset?cql=(coll_id=758)</request_uri>
    <version>2.1.0.236:07ebc5929cac</version>
  </header>
  <items/>
</response>

So parameters are added (else we would have seen a syntax error), but
1. they don't work as expected
2. there's no documentation about usage

Changed 3 years ago by forgacs

Usage with double '='. Eg.: cql=(app_id==5) or cql=(coll_id==758)

Changed 3 years ago by robert

  • status changed from reopened to closed
  • resolution set to ready_for_review

Changed 3 years ago by robert

  • status changed from closed to reopened
  • resolution ready_for_review deleted

Changed 3 years ago by robert

  • status changed from reopened to closed
  • resolution set to fixed

Changed 3 years ago by Frans

  • tested changed from no to yes
  • accepted changed from no to yes

Works like expected.
Still in need of good documentation on CQL: this is a new ticket: #287

Note: See TracTickets for help on using tickets.