Reputation: 7871
I am new to Solr
.
I am not able to find out a proper document which could help me understand what all do I need to add in the solrconfig.xml
and what is to be removed.
My SolrDocument
would contain id, field1, field2
. Out of the 2 fields, I want to update 1 of them. How do I do? I tried a few things but it overwrites the entire document.
/update
is not working.
I have to add documents
and retrieve them from inside a Java
class.
Upvotes: 1
Views: 213
Reputation: 1077
You can refer to Solr Wiki for Solr Config.xml it is a good starting point to understand the configuration options.
Solr does not really have an update concept, it always deletes the existing document and replaces it with new document. There is a feature request open years back JIRA-139 to address this problem, but as of today it shows the fix version to be 4.1. But Solr 4.0 has a new feature Atomic update
that you could try, if this is something very critical for you. Note: Solr 4.0
is still a Beta.
'/update' not working -> do you mean not working since it is replacing the old document with new document or do you get error/exception ?
To add & retrieve documents from Java, you can use SolrJ
. SolrJ is Java client to access Solr programmatically. SolrJ - Solr Wiki.
Upvotes: 3