TYPO3 SolrConnection removed search, what now? - solr

what is the new approach to fetch data from solr within an extbase Service class? we previously did it with
$solrResponse = $this->solr->search('type:car', $offset, $limit);
$this->solr is an instance of
ApacheSolrForTypo3\Solr\System\Solr\SolrConnection
but the method search got removed in the newer version of the extension "apache-solr-for-typo3/solr" (currently using 9.0.2) and now i cant find the replacement for that one.
did someone else got that issue too? why we need that in an extension service? well we index an external graphQL into our TYPO3-solr.
help is much appreciated

We have switched to Solarium as a new PHP Solr Library.
https://solarium.readthedocs.io/en/stable/
or dig here:
https://github.com/TYPO3-Solr/ext-solr/tree/master/Classes/Search
HTH
Olivier

Related

What is going to replace the DataImportHandler in Solr 9.0?

The latest documentation (8.8) for Apache Solr says that the Data Import Handler is deprecated is going to be removed in future versions. It only lists a third-party plugin maintained on Github, and no other native alternative to import data from relational databases. Am I missing something or has Solr dropped native support for this?
Data import handler will still be there, but as a contrib package.
I'll do what I did before data import handler existed and write a separate program. I prefer Python, where reading a database and sending JSON updates is pretty simple.
Be sure to batch the updates.
Alternative solr DIH
https://github.com/saro-lab/solr-db-importer
I made an alternative program to DIH and released the source code and manual.
I want to implement your solr-sb-importer
But it seems stay stuck at running.
I suspect the loading of the schema is not working
http://localhost:8983/solr/succesboeken_sb/sb-schema
I get:
Exception in thread "main" org.springframework.web.client.HttpClientErrorException$NotFound: 404 Not Found: " Searching for Solr? You must type the correct path. Solr will respond."
while excecuting:
java -jar solr-db-importer-1.4.jar
I am using Solr 9.1.0
Have you encountered this before?

upgrade solr from 4.2.1 to 5.3.1

I've been tasked with migrating from our solr 4.2.1 server to a new solr server, 5.3.1. I was hoping I could just pick up the cores, and move them over with a little but of editing files. But atlas, I can't quite figure it out.
I have tried moving a single core, and creating a core.properties files with the name of the core and I get:
testcore: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Error loading class 'solr.JsonUpdateRequestHandler'
Any thoughts as to what the problem might be? Any thoughts would be appreciated, thank you!
I am in the final stages of the similar upgrade; here is how I suggest you proceed.
Install both versions side by side and create the collection in new solr
Take your default schema/solrconfig from the new solr and move stuff into it from your old schema/solrconfig. The formatting changed, so you will need to manually move all of your config.
Make sure that works
Move the indexes - once your solrconfig and schema match up you should be able to use your old indexes (data directory).
To complete the upgrade you will need to re-index into a new but similar collection. This will upgrade the underlying lucene indexes. Your new version of solr has cursor mark support so it becomes much simplier; especially if you are using collection aliases.
JSON does not have its own request handler any longer (changed in 4.x, removed in 5.x). It has now been merged into the standard solr.UpdateRequestHandler, and the request handler is selected internally based on the Content-Type header of the request.

Solr - Migrate Documents from one Collection to another existing one

I need to move all Solr Documents from one collection to another (already existing collection) - there are 500,000 documents.
I have tried the solr migrate but cannot get the routing key correct. I have tried:
curl 'http://localhost:8983/solr/admin/collections?action=MIGRATE&collection=oldCollection&target.collection=newCollection&split.key=!'
I have solr 4.10.3 installed in a cloudera installation.
Copy your existing oldCollection, and rename the as newCollection,
After that you may need to update some config files for the same.
Or create a new one using the below api
https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api1
The answer and the question are quite old, starting from 8.1 solr version, there is a feature specific for this purpose which is the reindexcollection api which can directly be used to reindex docs from source to a target collection with a lot of configurable options. Here is the link to the official doc : https://lucene.apache.org/solr/guide/8_1/collections-api.html#reindexcollection

Solr dynamic schema updation using solrj

I am a new to solr working on solr version 4.8.0. I want to add/update/delete fields in the schema.xml at runtime using solrj. i can create or delete a core using solrj.
For adding documents or search using solrj, i referred this link
I want to learn advance functionality in solrj. I need any good tutorials or example code.
Can anyone please guide me?
Thanks in advance.
Solrj version 5.3 (features) introduced an experimental Schema API.
I think this page - https://wiki.apache.org/solr/SchemaRESTAPI contains all you need. Pay attention to Modifying the schema section. Although, it's not SolrJ way but it will work fine for you.

Making one of Liferay communities (called sites) not indexed in solr

We are using Liferay (6.1.20 EE) with Solr search engine.
Now Solr indexes everything. Can we somehow set up Solr (or Liferay) to prevent one Site from being indexed?
It means all articles documents present on that Site would not be indexed and would not be present in Solr.
1) Should this be done with Solr configurations/schema filters before Index starts?
OR
2) Should it be customized in Liferay Indexer classes (with help of Hooks or EXT) to skip content being indexed.
Thanks for your thoughts and suggestions.
Regards,
Kris
You could create a custom version of the solr-web WAR file that you need to install to make the Liferay/SOLR integration work. In the WAR file you'll find SolrIndexWriterImpl. This is the place that everything passes through that will be indexed in SOLR. You could create your own custom implementation of this class that uses the information in the SearchContext parameter, that's passed into each method, to decide if something should be indexed or not.
The latest code for solr-web can be found here: http://svn.liferay.com/repos/public/plugins/trunk/webs/solr-web/
Based on this code I was also able to create a solr-web.war that works on the more recent SOLR versions instead of the ancient 1.4.1 version Liferay uses by default.

Resources