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)
{
"responseHeader": {
"status": 0,
"QTime": 25,
"params": {
"q": "testing",
"defType": "dismax",
"qt": "",
"indent": "true",
"wt": "json",
"_": "1476349027637"
}
},
...
"docs": [
{
"id": "_DEFAULT_!8000000000000040!80000000000008e3",
"_version_": 0,
"DBID": 2275
},
{
"id": "_DEFAULT_!8000000000000072!8000000000000902",
"_version_": 0,
"DBID": 2306
},
{
"id": "_DEFAULT_!8000000000000040!80000000000008ea",
"_version_": 0,
"DBID": 2282
},
{
"id": "_DEFAULT_!800000000000000b!80000000000008ef",
"_version_": 0,
"DBID": 2287
},
{
"id": "_DEFAULT_!8000000000000071!80000000000008f0",
"_version_": 0,
"DBID": 2288
},
{
"id": "_DEFAULT_!8000000000000025!80000000000008eb",
"_version_": 0,
"DBID": 2283
}
]
},
"processedDenies": false
}
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 ?
2) How do I get the relevant Alfresco document ID to be able to retrieve the same from the search result ?
EDIT:
Some background about my requirement to use Solr directly
Alfresco will be used to create documents based on some templates by interal users (business content administrators from Intranet typically). We've a front end web app (customer facing) which will have a Search section. When users perform a search operation with some keywords (Typically full text search), we would be invoking Solr API to search content in the documents created by Business Admins and the same results would be displayed on the Front end of Web app. When users clicks on the respective search results, the document content would be retrieved from Alfresco & displayed on the Front end webapp.
Thanks in advance.
It would be much easier to implement it as Alfresco Web Script.
With Web Scripts, you can either build your own RESTful interface
using light-weight scripting technologies such as JavaScript and
Freemarker.
Using web script you can access search root object:
search - org.alfresco.repo.jscript.Search -
Root object providing access to the various Alfresco search interfaces
such as FTS-Alfresco, Lucene, XPath, and Saved Search results
Your REST web script may be available to every user but run as admin:
<webscript>
<shortname>My Rest Query</shortname>
<url>/api/my/query</url>
<format default="json">argument</format>
<authentication runas="admin">guest</authentication>
<transaction allow="readonly">required</transaction>
</webscript>
There are many tutorials...
1) The ID returned by Solr is probably the ID of the indexed document in Solr. You can't use it with Alfresco.
2) It seems that Solr returns the DBID of the nodes. DBID is the property sys:node-dbid from aspect sys:referenceable defined in the file systemModel.xml and which refers to the database id of the node.
You can build an Alfresco repo webscript which takes this DBID as parameter and returns the document.
But as imagine said, you'd better directly ask Alfresco to execute your Solr query. It would return a list of documents with all the metadata you need, including the download URL of each document.
Adding a partial answer to your 2nd question because locating this info was hard and took quite some time. (2. How do I get the relevant Alfresco document ID to be able to retrieve the same from the search result ?)
To find the document associated with that DBID, you can use the following search syntax:
Go to Admin Tools -> Node Browser
Change query type to lucene
Enter the following search term: #sys\:node-dbid:THE_DBID_YOU_WANT_TO_FIND
For example, looking at our local solr4 error report:
{
"responseHeader":{
"status":0,
"QTime":0,
"params":{
"q":"ERROR*"}},
"response":{"numFound":2,"start":0,"docs":[
{
"id":"_DEFAULT_!800000000000008c!8000000000002289",
"_version_":0,
"DBID":4499},
...
To find that document, search for: #sys\:node-dbid:4499
You can add quotes around the numeric DBID - it works with and without them.
The '#' and the first backslash '\' (escaping the first colon) are REQUIRED - the query breaks if these are removed and an error will be logged in catalina.out.
The second colon MUST NOT include a backslash escape - it is NOT an error (nothing in the log) but no result will be found.
If necessary change the search scope from workspace://SpacesStore to archive://SpacesStore to locate docs that have been deleted.
You can join the DBID's as shown below to find them all at once (at least those in the same spaces store):
#sys\:node-dbid:1234 OR #sys\:node-dbid:2345 OR #sys\:node-dbid:...
Related
I'm trying to build a simple Aframe chat hub like Mozilla Hubs using networked-aframe with janus as adapter. I've installed everything in one server and everything is working fine.
However, I'm trying to set a limit for max amount of users to be connected in one 'room' because otherwise the browser might crash because of too many avatars to render, then redirect new users to connect to a new randomly generated room automatically.
Is there a way to do so by using the available Janus API? So far I've tried this Janus Signalling API for SFU plugin because it's the only reference that mention how to get how many users in one room, although not directly.
The example request body:
{
"kind": "join",
"room_id": room ID,
"user_id": user ID,
"subscribe": [none|subscription object]
}
The example result, but I think it should not be done like this to achieve what I want because I need list of ALL rooms, not just 1 room:
{
"success": true,
"response": {
"users": {room_alpha: ["123", "789"]}
}
}
I've created an cloud firebase type database in firebase. Plz have a look at the image below. But How to access the datas from API(get)? If I use real time database, simply 'https://[PROJECT_ID].firebaseio.com/users/jack/name.json' this url gives the json data. But using cloud firebase database, I'm unable to get json data. I've tried to use "https://firestore.googleapis.com/v1beta1/EmployeeApp/name=employeeapp-66646/newsFeed/" but it doesn't work.
Here is an example of a URL for one of my databases:
https://firestore.googleapis.com/v1beta1/projects/project-8080059325282098184/databases/(default)/documents/52679469/docid
An explanation of the variable parts in here:
project-8080059325282098184 is my project ID.
(default) is the name of the database. At the moment you can't specify a name for your database, so yours will be (default) too.
52679469 is the name of my collection.
docid is the name of my document
The JSON I get back:
{
"name": "projects/project-8080059325282098184/databases/(default)/documents/52679469/docid",
"fields": {
"field1": {
"stringValue": "value1"
}
},
"createTime": "2018-10-06T14:16:24.090837Z",
"updateTime": "2018-10-06T14:16:24.090837Z"
}
In this response:
name is the full path of this document.
fields is the data of the document.
createTime and updateTime are the metadata for the document.
The following URL will do the trick:
https://firestore.googleapis.com/v1beta1/projects/employeeapp-66646/databases/(default)/documents/newsFeed
Have a look at the doc here, for detail on how to build the URL.
Working with one of my Google Apps users and a shared calendar he create suddenly disappeared. It was hidden (first thing we checked), but just gone. It is a number of steps to delete a calendar (for safety reasons) and it was certainly not deleted in this fashion.
Using the Google APIs Explorer for Calendar API v3 we do see a deleted calendar using calendar.calendarList.list when showDeleted is true. If we highlight that item in the JSON response the dropdown arrow on the top right of the item shows it can be used in calendar.calendarList.patch. Trying to remove the "deleted" flag results in a 404 resource not found. Copied the calendarId from the Patch JSON body up to the calendarId box, fields editor to show most all fields. Trying the same for calendar.calendars.patch we get the same result.
The OAuth scope is https://www.googleapis.com/auth/calendar. JSON body is
{
"kind": "calendar#calendarListEntry",
"etag": "\"XXXXXXXXXXXXXXXX\"",
"id": "XXXXXXXXXXXXXXXXXXXXXXXX#group.calendar.google.com",
"defaultReminders": [
],
"deleted": false
}
If a calendar is deleted from the CalendarList but you still know the id, you can add it back to the list with the insert endpoint.
How can i find-out whether the content of a file is indexed or not in
alfresco?
I am using alfresco-5.0.d.
You can hit the Solr web app directly. First, figure out what your node's sys:node-dbid is. You can get that from the node browser in the admin console.
Suppose it is 6834, for example. You can then go to:
https://localhost:8443/solr4/alfresco/select?q=DBID:6834&wt=json
Which will return:
{
"responseHeader":{
"status":0,
"QTime":0,
"params":{
"q":"DBID:6834","wt":"json"
}
},
"response":{
"numFound":1,
"start":0,"docs":[{
"id":"_DEFAULT_!800000000000000b!8000000000001ab2",
"_version_":0,
"DBID":6834
}]
}
}
Assuming the node has been indexed. If it has not been indexed, numFound will be 0.
Doing this assumes you have the client certificate Solr and Alfresco are using to identify each other added to your browser.
I have a template to create a key vault and a secret within it. I also have a service fabric template, that requires 3 things from the key vault: the Vault URI, the certificate URL, and the certificate thumbprint.
If I create the key vault and secret with powershell, it is easy to manually copy these 3 things from the output, and paste them into the parameters of the service fabric template. However, what I am hoping to do, due to the fact that this cert has the same life cycle as the service fabric cluster, is to link from the key vault template to the service fabric template, so when I deploy the key vault and secret (which btw is a key that has been base 64 encoded to a string. I could have this as a secret in yet another key vault...), I can pass the 3 values on as parameters.
So I have two questions.
How do I retrieve the 3 values in the arm template. Powershell outputs them as 'ResourceId' of the key vault, 'Id' of the secret, and 'Version' of the secret. My attempt:
"sourceVaultValue": {
"value": "resourceId('Microsoft.KeyVault/vaults/', parameters('keyVaultName')"
},
"certificateThumbprint": {
"value": "[listKeys(resourceId('secrets', parameters('secretName')), '2015-06-01')"
},
"certificateUrlValue": { "value": "[concat('https://', parameters('keyVaultName'), '.vault.azure.net:443/secrets/', parameters('secretName'), resourceId('secrets', parameters('secretName')))]"
But the certificateUrlValue is incorrect. You can see I tried with and without listKeys, but neither seemed to work... (The thumbprint is within the certUrl itself)
If I were to get the correct values, I would like to try pass them as parameters to the next template. The template in question has quite a few more parameters than the 3 I want to pass however. So is it possible to have a parametersLink element to link to the parameter file, as well as a parameters element for just those 3? Or is there an intended way of doing this?
Cheers
Ok, try this when you get back to the keyboard...
1) for the uri, you can use an output like:
"secretUri": {
"type": "string",
"value": "[reference(resourceId('Microsoft.KeyVault/vaults/secrets', parameters('keyVaultName'), parameters('secretName'))).secretUri]"
}
For #2, you cannot mix and match the link and some values, it's one or the other.
A couple thoughts on how you could do this (it depends a bit on how you want to structure the rest of your deployment)...
One way to think of this is instead of nesting the SF, deploy them in the same template since they have the same lifecycle
instead of nesting the SF template, nest the KV template and reference the outputs of that deployment in the SF template...
Aside from that I can't think of anything elegant - since you want to pass "dynamic" params to a nested deployment really the only way to do that is to dynamically write the param file behind the link or pass all the params into the deployment resource.
HTH - LMK if it doesn't...
Can't Reference a secret with dynamic id !!!!
The obvious problems with this way of doing things are:
Someone needs to type the cleartext password which means:
it needs to be known to anyone who provisions the environment and how do I feed it into an automated environment deployment? If I store the password in a parameter… ???????
"variables": {
"tenantPassword": {
"reference": {
"keyVault": {
"ID": "[concat(subscription().id,'/resourceGroups/',parameters('keyVaultResourceGroup'),'/providers/Microsoft.KeyVault/vaults/', parameters('VaultName'))]"
},
"secretName": "tenantPassword"
}
}
},