10-14-2016 04:24 AM
I'm using Alfresco 5.1 community Edition with Solr4 configured as Search Service and Transaction queries configured as Hybrid (Solr & DB) When I do a search in Solr GUI from the below URL Solr Query GUI: https://localhost:8443/solr4/#/alfresco/query I get the search results in the below format with some ID & other info. Solr Search Result (Results JSON truncated for readability)
I'm trying to build a UI where in these search results displayed, a user can click through to retrieve the respective document in Alfresco. Below is the Alfresco API I use to retrieve content from Alfresco. Alfresco API URL to open a Document : http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/atom/content?id= A sample Alfresco document ID looks like the one shown below. I don't get such ID returned in Solr4 search results. Sample Document Id: 7edf97f4-43cf-4fe5-8099-85608776d159 Questions: 1) What is the ID returned by Solr4 ? Thanks in advance. |
10-14-2016 07:02 AM
The "DBID" returned by SOLR is the raw database ID. The "id" is just an internally generated document ID and not associated with any data of the node. What you might want is the "ID" field which should be the NodeRef - the last uid fragment of the NodeRef (along with a version identifier) is what you'd need to use the CMIS API. Alternatively, you can also select the actual property fields for store protocol, identifier and the node uuid, but the names for these are very clunky.
10-14-2016 05:02 PM
10-18-2016 04:07 PM
NodeService has a method to get NodeRef from DBID. That's what Alfresco does in SolrJSONResultSet.java.
NodeRef nodeRef = nodeService.getNodeRef(dbid);
You can do similar "post-processing" of the data returned from Solr.
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.