Forum OpenACS Development: Re: How to make an object type searchable?

Collapse
Posted by Iuri Sampaio on
Antonio,

One Problem solved. objects have been indexed successfully!

Notice: Running TCL ad_prc qt_vehicle__datasource
[06/Aug/2020:21:12:07][4365.7efbebfff700][-sched:0:3:10-] Notice: ROW 202759 {2020-08-07 00:07:22.410127+00} UPDATE
...

Lessons learned:

1. Never forget to set a revision as "live". Then the search can return it.

2. As I copied datasource ad_proc implementation from fs_object, its SQL query searches only "content" column. However, my object_type has data only in title and description columns.

db_0or1row fs_datasource "
select r.revision_id as object_id,
i.name as title,
case i.storage_type
when 'lob' then r.lob::text
when 'file' then '[cr_fs_path]' || r.content
else r.content
end as content,
r.mime_type as mime,
'' as keywords,
i.storage_type as storage_type
from cr_items i, cr_revisions r
where r.item_id = i.item_id
and r.revision_id = :revision_id
" -column_array datasource

Now the issue is to display the results.

The results are there. Pagination shows a bunch of pages. but no results are visible to the user.

https://dashboard.qonteo.com/search/search?q=plate&__csrf_token=F192516B843660460C5FAC68FEBA6DD372F383BF

I noticed when search engines runs, logs returns

Notice: Running TCL ad_prc qt_vehicle__datasource
[06/Aug/2020:21:30:56][6145.7efbf3d70700][-conn:qonteo:0:3-] Notice: Running TCL ad_proc qt_vehicle__url
[06/Aug/2020:21:30:56][6145.7efbf3d70700][-conn:qonteo:0:3-] Error: search.tcl object_id 108031 object_type qt_vehicle error Query did not return any rows.

However, the object exists

select * from acs_objects WHERE object_id =108031
qonteo-# ;

object_id | object_type | title | package_id | context_id | security_inherit_p | creation_user | creation_date | creation_ip | last_modified | modifying_user | modifying_ip
-----------+-------------+-------+------------+------------+--------------------+---------------+-------------------------------+---------------+-------------------------------+----------------+---------------
108031 | qt_vehicle | 70433 | 860 | 108029 | t | 726 | 2020-07-28 00:00:15.961343+00 | 178.62.211.78 | 2020-07-28 00:00:15.961343+00 | | 178.62.211.78
(1 row)

Collapse
Posted by Iuri Sampaio on
Resolved!

Another problem in the content_type creation. As there's no folder_id in this context, the parent_id must be the same as package_id. At least for now.

Best wishes,
I