Hi I am using Tridion CMS and have configuration with SOLR, however, I would like to add new fields. I have added new fields in Tridion, but they are not being configured properly in SOLR, is there a step that I might be missing when configuring the new fields? If possible, is there a walkthrough of the necessary steps to make sure that the new fields are being configured between Tridion and SOLR properly?
Related
We are using solr.SynonymFilterFactory with synonyms.txt in Solr during querying. I realized that there is an error in synonyms.txt, corrected it and uploaded the new file. I can see the modified synonyms.txt from Admin. But it looks like the queries are still using the old synonyms.txt. I am executing test queries from Admin with debugQuery=true and can see the synonyms getting used. How can this be fixed? It is a production environment with 3 nodes using zookeeper for management.
You'll need to reload your core for the changes to take effect.
In a single-node Solr you can do that from the Admin page: go to Core Admin, select your core, and hit Reload. This will slow down some queries but it shouldn't drop queries or connections.
You can also reload the core via the API:
curl 'http://localhost:8983/solr/admin/cores?action=RELOAD&core=your-core'
I am not sure how this works on an environment with 3 nodes, though.
I'm a newbie to SOLR and there's a problem I can't solve so far: When I'm starting SOLR cloud with Zookeeper I like to create a collection with a personal schema. However, SOLR only loads the default 'example-data-driven-schema'.
Any suggestion what I should do in order to put my defined schema to it?
In order to create a new collection with your own schema, you need to use zkCli.sh and SolrCloud Collection API.
In particular, you could:
a) upload in Zookeeper (using Solr zkCli) the configuration directory for your new collection, for instance in
<my_new_config>
Examples of Solr ZkCli commands to upload your changes in ZooKeeper can be found here.
In particular, if you want to upload your configuration directory on Zk, you can:
STEP 1) run the command:
./server/scripts/cloud-scripts/zkcli.sh -zkhost 127.0.0.1:9983 \ -cmd upconfig -confname my_new_config -confdir server/solr/configsets/basic_configs/conf
STEP 2) Restart your Solr nodes so they can pick up the configuration changes.
Please remember that if you wish to replace an existing file in Zk you will need to use zkCli.sh clear to delete the existing one from ZooKeeper and then the putfile command to add the new one.
b) call the following API from your browser:
/admin/collections?action=CREATE&name=<my_collection_name>&collection.configName=<my_new_config>
I'm using Solr 4.3. I've created 4 shards. I configured UniqueKey autogenerated field as described here:
http://wiki.apache.org/solr/UniqueKey
It works fine if I use the actual update handler to insert documents (i.e. if I make a HTTP POST to /update with some JSON data, the unique key is autogenerated for each document).
If however I use the DataImportHandler to pull some documents from database, they are not added to the index, instead I see a warning in the Solr log saying that "mandatory id field is missing".
I know the DataImportHandler doesn't go through the UpdateHandler to add documents, but I was hoping this feature would work for DIH as well...
So my question is: does anybody know how to make work the id autogeneration for a Solr 4.3 cluster when using the DataImportHandler to insert documents?
Well, the solution I ended up using was this
created a custom transformer in Java (actually I was already using one - I find it's faster than doing them in JS - the other option Solr offers)
Inside the transformer I pretty much do what the UUIDUpdateProcessorFactory does: add
#Override
public Object transformRow(Map<String, Object> row, Context context) {
row.put("id", UUID.randomUUID());
I then removed the <updateRequestProcessorChain name="uuid"> tag from my solrconfig.xml, and only left the schema.xml configuration as per the link in the question
I'm new to Solr. I'm implementing auto complete functionality for my application. I have configured the required fields in solr and created a custom request handler /suggest. I'm finding it tricky to access it via solr java client solrj. I'm even fine with the spring data for solr. Please somebody help to access my custom request handler from solr java client.
With spring-data-solr you might add #Query(requestHandler = "/suggest") or use query.setRequestHandler("/suggest").
In case you're doing autocomplete you might also give /terms and the SimpleTermsQuery a try.
SolrJ supports this through the use of the setRequestHandler method on the SolrQuery class.
I try to add new data to the solandra according to the solr's schema but I can't find any example about this. My ultimate goal is to integrate solandra with django-solr.
What I understand about the insert and updating in the solr based on the original solr and django-solr is to send the new data on the http protocol to the decent path, for example:
http://localhost:8983/solandra/wikipedia/update/json
However, when I access the url, the browser keep telling me HTTP ERROR: 404.
Can you help me understand the step to add new data and delete the data in the solandra environment?
I also have a look at the reuters-demo, but the procedure to insert data is process in the file of reutersimporter.jar, but I can't see the source as well. So Please help me to understand how the system work in terms of data inserting and deleting.
Thank you.
Since you are using the JSON update handler, this UpdateJSON page on the Solr Wiki has some good examples of inserting data using the JSON handler via curl. Also, the Indexing Data section of the Solr Tutorial shows how you can insert data using the post.jar file that is included with the Solr source.
Are you creating the solr schema.xml and solrconfig.xml and posting it to solandra? If you add the JSON handler then this should work. The reutersdemo uses solrj. django-solr should work as well.