In one requirement I need to query just created document. If I use lucene search then it will take few seconds to do the indexing and may not come in the search result.
The query should be executing from some alfresco webscript or a scheduler which runs every 5 seconds.
Right now I am doing it by using NodeService and finding child by name which is not the efficient way to do. I am using JAVA API.
Is there any other way to do it?
Thank you
You don't mention what version of Alfresco you are using, but it looks like you are using Solr.
If you just created the document, the recommendation is to keep the reference to it, so you don't have to search for it again.
However, sometimes it is not possible to have the document reference. For example, client1 is not aware that client2 just created a document. If you are using Alfresco version 4.2 or later, you can probably enable Transactional Metadata Queries (TMQ), which allows you to perform searches against the database, so there is no Solr latency. Please review the whole section, because you need to comply with four conditions to use TMQ:
Enable the TMQ patch, so the nodes properties tables get indexed in the database.
Enable searches using the database, whenever possible (TRANSACTION_IF_POSSIBLE).
Make sure that you use the correct query language (CMIS, AFTS, db-lucene, etc.)
Your query must be supported by TMQ.
Related
I have a .NET 6 application that writes logs out to a SQLite file each time a cycle is completed. I'm using EF Core.
The application sits on a Raspberry Pi with limited resource, so I want to keep the live database small as when it gets large the system slows down. So I want to archive the logs to only keep the last 50 or so logs in the live database.
I am hoping to create a method that will will create a new SQLite database file and then copy the last oldest record over when a new log is created. I'd also want to limit how big the archive file is, maybe split out to create a new one once it reaches a certain size on disk.
I've had a look around and can't find any best practices anything documented. Could someone give me a steer to the best way to achieve this or similar.
I solved my issue by putting EFCore aside and instead using the sqlite-net-pcl nuget package from SQLite-net.
This allowed me to separate the creation of my archive and also apply additional commands not supported in EFCore like vacuum.
I still use EFCore and Linq to query the records to create my archive with and then again to remove those records once the archive is created.
I would like to understand how does the Alfresco Repo works whenever any document is uploaded. How exactly the content is stored in file system metadata in DB and indexes in Solr respectively ?
You have to dive deep down in Alfresco documentation and code as well for getting all these clarifications.
Alfresco stores the documents in the physical directories in proper folder structures(which you can define in your code as well). CMIS services expose the functionalities for all operations which you can perform on documents. CMIS internally uses cache in CMIS session for better performance.
Documents metadata and node references all are being stored in DB(PostgreSQL) and indexing of documents are being done automatically through Solr in latest versions.
You have to specify the fields which you want in Solr document for indexing. Searching documents in Solr is faster than DB but queryConsistency is Eventual for Solr. So, as per your use case you have to decide whether query Solr or DB.
So, whenever any operation(CRUD) on any document is being done, it reflects in DB first then async indexing of that document happens in Solr. This Async indexing leads to Eventual consistency.
I'm looking for an efficient way to remove a large set of artifacts, spread across various locations from Artifactory (by retrievable with a search query).
I've tried using the JFrog CLI 'rt del' command (along with an AQL file) to search and then remove results, and this works. However, I am finding the removal rate is pretty slow for our instance -- around 1 artifact removal/sec. I will need to remove several hundred thousand artifacts, and this will take way too long. So I am looking for a batch removal mechanism which executes entirely serverside.
I noticed the Artifactory UI supports a 'search stash' feature where a search can be performed, then saved off and results can be acted upon (including deletion action). Is this available via the REST API? This seems like it would be a good match for this use-case.
Alternatively, is there a way to perform a search by creation date in the UI? If so, I could presumably use the search stash feature and perform the removal on the search stash.
Last option I can think of is to write a custom plugin to do this work, but I am hoping there is an easier way as it seems like a semi-common case.
Thanks in advance!
Deleting from search stash would delete the artfifacts from the stash results but won't delete from the artifactory(as per my understanding).
There is groovy plugin available that will clear your artifacts depending on few conditions(link below)
Groovy Clean Up
I found Artifactory AQL quite helpful in searching and deleting artifacts.
Also I had written a custom clean up script that in turn used aql to delete the artifacts for repo regex match and also checks for the artifacts promotion status
I have probably multiple newbie questions but I am unsure about how to work with telepat based on just the document.
While creating an APP, we are expected to give a Key. However the field name is keys. Is there any reason for it? I am assuming that it would have to be unique but document does not mention if that is the case or the error we should expect in case the rule is violated.
Referring to http://docs.telepat.io/api.html#api-Admin-AdminCreateContext Admin Create does not seem to require authentication even when doing it from API. It also misses the response on success. Just a 200 may be sufficient but..
There is no way to get App ID. What am I missing?
First of all, what version of Telepat are you using ? Changes to the infrastructure happen often. The latest version is 0.2.5 (although I'd try to download from develop branch since improvements and bug-fixes appear on a day-by-day basis).
You can add multiple API keys for an application and distribute them in whatever way you want. The system is not bothered if you add a key that already exists at the moment.
May be because of old Telepat build. Can't get into detail with this.
admin/app/create returns the application object, including its ID. Also /admin/apps returns a list of all applications you have.
I’m programming en ASP MVC3 application. One part of that application should be a product list containing faceted search, full text search and distance search. After a while of research I found SOLR and SOLRNet.
I have installed Solr on a Tomcat 7 and included a DataImportHandler for Indexing data from my MS SQL database.
Now I have a problem perhaps only an understanding problem:
The facets I want to use are placed in the database and could change
every time. Where I have to implement the facet indexing? In the ASP MVC application or in the data-config of solr?
How does solr work in combination with solrnet, solr have to get a
new index of my database for each search, correct?
How to make solr indexing the data from solrnet?
Have I to rebuild the index after every change?
A lot of questions and I would be happy if someone knows the answer of some of them.
Thank you very much and have a nice weekend!
The facets I want to use are placed in the database and could change every time. Where I have to implement the facet indexing? In the ASP MVC application or in the data-config of solr?
You mentioned you already set up DataImportHandler to index your data, so populating the index is just a matter of running a scheduled full-import or delta-import.
How does solr work in combination with solrnet, solr have to get a new index of my database for each search, correct?
No, you don't need to recreate the index for every search.
How to make solr indexing the data from solrnet?
You mentioned you already set up DataImportHandler to index your data, that's a valid approach to populate your index by having Solr pull data from the database. If you want to push data to your index using SolrNet instead, use the Add/AddRange methods.
The facets I want to use are placed in the database and could change every time. Where I have to implement the facet indexing? In the ASP MVC application or in the data-config of solr?
Solr provides out of the box faceting.
you would index the data you need to facet in schema.xml and enable faceting during the searches in solrconfig.xml.
On the application side you just need to process the facet data return by Solr.
http://www.lucidimagination.com/devzone/technical-articles/faceted-search-solr
How does solr work in combination with solrnet, solr have to get a new index of my database for each search, correct?
Usually the client (java and ruby) interacts with Solr through http executing searches and processing the results providing you an easy access.
So everytime the search happens Solrnet would be querying the latest index.
Have I to rebuild the index every change?
With Data import handler you can incrementally index you data periodically.
The timestamp handling is performed for you by Solr.
You would need to have jobs which would perform the incremental indexing.
However, if you need to have the data reflected with every change you would need to index the data through application.
Dataimporthandler, with Solr on Tomcat 7 should work fine. Check the jdk version as jdk 7 had some issues with Solr/Lucene.