File location listing from the collection search

We were trying to list files by criteria set forth in the collection search method. We have got the results. But when we tried to specify the location of the search resulted files in order to print out the output table, the location column showed only blank space. What have we missed out? Any suggesting help would be appreciated. We use the Plone 5.0.8 python 2.7.9

I would start with a check of the catalogued data. Visit portal_catalog in the "ZMI". It has a tab which allows you to search for objects via their path. Following the link to an object gives you detailed information about the data the catalog has for this object. Check that the metadata has the field location and that it has correct values.

DearDieter,
Thanks a lot. I have some idea about the portal_ catalog in ZMI, but have never tried visiting it. Will try following the links in that. will report back.

Dear Dieter,

Excuse me for having dropped out for a while. I managed to look into the portal_catalog in the ZMI. When I looked into the "Metadata" tab, there were a lot of meta data listing, with the check box in front of each item, one of them is the "location" checklist. I have to confess I did not know to go from there. My problem is that the location fo the files of which I searched did not shown in the table of collection search. Could you give me some hint?

Dear Dieter,

I have looked into the "Indexes" tab of the portal_catalog and found that there is no path index in the first column of the page. Do I need to add the path index to this "Indexes" list? The location meta data in each catalog in the catalogs tab has shown a blank space. I guessed that this is the main reason that it did not show up in the collection search. Please shed some light on it?

That explains the blank in your view.

Next task: find an understanding why the catalog lacks meaningful location information. Note that the blank likely means "missing".

I would start by changing one of the objects with bad location. This should reindex the object. Then check whether the location information has changed in the catalog for this object. If not, something is wrong with the determination of the location information. I would use debugging (in an interactive interpreter) to find the cause.

You mean I should check the collection search object, the one that we tried to list the file location? Could you please be more specific on how do I change this object. I'm afraid I do not know where to go from here. I'm pretty new to Plone. Many thanks in advance.

I would check in the catalog (the way you have learned recently).

Change it in any way you like, e.g. edit the title or the description or the location ... (via the Plone UI). The important thing is that the object gets reindexed.

Dieter:

I have a bit more working on the portal_catalog. What I wanted is the path information of the searched file from the collection search. I found that the path has been already provided as one of the indexes of the catalog. I also checked the catalog object of the collection search, the path has been rightly written/shown on that object. But when I specified that path to be shown on the printout of the collection search, it shows a blank space. Why is this so strange an output?

I've already done the re-indexing.

You see here how important precise naming is. Previously, you spoke of location and I have translated this into "custom metadata field", not into path.

When I remember right, then the "collection search" can access all metadata fields. While there is an index named path, there is no metadata field with this name. The index path does something special: it indexes a string version of getPhysicalPath. To have access to the path of a document in the "collection search", you will need to define an appropriate metadata field, ensure it will get the properly formatted "path" information and reindex. Alternatively, you can customize the "collection search" template: the object proxies returned by the catalog provide access to their "path" via the method getPath.

It was my fault to wrongly refer it to "location", of which I thought is the same as "path." Sorry. I'll try to follow your suggestion and will come back to report. Many thanks.

Maybe it is worth looking at Plone's search view, since it shows the path ( located in)

https://plone.org/@@search?SearchableText=plone