Changing Schema.xml in SolrCloud setup - solr

how do i change the schema.xml for a collection in SolrCloud?
I have set up a zookeeper-ensemble on 3 nodes and i guess i could make the changes there, but don't know exactly.

You can reload schema.xml for cores on SolrCloud by using zkCli.sh
More details in the Stackoverflow link: Reloading Zoo keeper solr conf (schema.xml)

As of Solr 5.x released, a Schema API was implemented to change the Schema more easily:
https://cwiki.apache.org/confluence/display/solr/Schema+API

The easiest way would be to use 1 node as a bootstrapper, you may add a bootstrap_configdir pointing to your configuration directory. Restarting the service would upload configuration files.
Another option is to use the ZkCli - you can find the usage examples here: http://wiki.apache.org/solr/SolrCloud

Related

Managed-schema.xml file is overwritten when I populate Solr Managed Schema from Sitecore

In my solr managed-schema.xml file I added the following:
<copyField source="computedtitle_t" dest="computedtitlecopy_t" />
When I populate-schema from Sitecore, the managed-schema file is overwritten and so are my changes
Is there a patch file on the Sitecore side where I can add this and to what section?
Yes, Sitecore manages the Solr schema for you through the populate-schema function in the Control Panel. This is done via the SchemaPopulateHelper. You can implement your own class, implementing the ISchemaPopulateHelper interface and register it in the config.
A while back, I wrote a generic implementation of this where you can put your entire managed schema as part of the Sitecore config instead. This also allows leveraging from the Sitecore config file patch feature, so that your schema changes can go along with other Sitecore configs if needed.
You can read more about it here: https://mikael.com/2020/10/dealing-with-solr-managed-schema-through-sitecore-config-files/
Here are some more generic info about how Sitecore works with Solr and managed schema: https://mikael.com/2018/01/working-with-content-search-and-solr-in-sitecore-9/
You can use the code here as a starting point: https://github.com/mikaelnet/sitecore-solr-config
Please note that there was a small interface change in Sitecore 9.3 (I think), so the sample code may need some changes for it to work. Also, make sure you start with a managed schema that is equal to the one that's provided with the Sitecore version you're using. There may be a few changes in the default schema between the versions.

Solr 6.1.0 loses cores after restart

I installed a new solr instance for testing. I used this documentation: Take solr to production
It's working fine but on restart I'm losing all cores. They are not deleted but on start solr does not find them.
Any idea what is wrong?
.
You are most likely restarting Solr with a wrong solr home, as discussed in the document you linked to.
You can check the core location in the Admin UI's Overview screen for that core. Your home is above that location, where solr.xml file lives. Or you can look for the solr.solr.home variable in the Java Properties screen.
check
/opt/solr/server/solr/solr.xml
or
/var/solr/data/solr.xml
update coreRootDirectory
<solr>
<str name="coreRootDirectory">/path/to/solr/data/</str>
<solrcloud>
I solved this by restarting the service

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 instance for sitecore 7

I am trying to implement solr into sitecore but could not find any way for creating a Solr instance for the same. I have few PDFs from SDN I could find any way to create Solr instance in any. Considering that I am new to CMS I hope I could get some help here. Thank you
There are lots of resources available for setting up Solr, and integrating Sitecore.
Essentially Sitecore is ignorant with respects to how you setup Solr (barring a few exceptions), so you need to follow standard methods to set Solr up. If you are doing this on your local machine, then I recommend you simply download Solr and get it running through the provided Jetty App Server.
Once Solr is running, download the Solr Extensions from SDN, then follow the search scaling guide to integrate Solr. This really only boils down to the following;
Remove Lucene config files
Add Solr config files and binaries
Add Solr endpoint into relevant config
Generate Solr Schema via Sitecore -> Control Panel -> Search (within Sitecore)
Add Schema file to Solr Core configuration
et voila
There is a great guide here: http://www.dansolovay.com/2013/05/setting-up-solr-with-sitecore-7.html

How to start work on Solrnet

I have installed Apache Tomcat 6 and configure Solr 1.4. Now Solr service running successfully.
In Solr 1.4 has two important file solrconfig.xml and schema.xml to configure c# application with Solr service.
But whenver I changed schema.xml file according to sql table’s field it’s stop the Solr service.
so tell me step by step to configure solrconfig.xml and schema.xml
Thanks,
Unfortunately, the question isn't clear or is too broad, so I can only give general advice and point to documentation.
But whenver I changed schema.xml file according to sql table’s field it’s stop the Solr service.
Yes, after changing your schema you either have to restart your Solr instance, or, if you are using Cores (recommended), you have to reload the changed core.
tell me step by step to configure solrconfig.xml and schema.xml
Just change the files according to your needs. The Solr package contains numerous examples, all thoroughly commented. Documentation on solrconfig.xml is here. Documentation on schema.xml is here. After making any change in solrconfig.xml you have to restart your Solr instance.
Also, when making changes to the schema, make sure you reflect those changes in your SolrNet mapping.

Resources