Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8500057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:50:15+00:00 2026-06-11T00:50:15+00:00

Solr 4 beta is out, the GA version will follow soon. Partial document updates

  • 0

Solr 4 beta is out, the GA version will follow soon. Partial document updates has been around for a while as explained here: http://solr.pl/en/2012/07/09/solr-4-0-partial-documents-update/

However, I haven’t figured out how to do it with solrj api.

Does anyone knows if it is possible with solrj? Or is solrj just not up-to-speed with this feature?

update: as I describe in the mailing list (see reply here), I found that in the solrj api, the value of a SolrInputField can be a map – it doesn’t have to be a simple scalar value.
If it is a map, solrj adds an additional update attribute to the field’s xml element.
For example,
This code:

SolrInputDocument doc = new SolrInputDocument();
Map<String, String> partialUpdate = new HashMap<String, String>();
partialUpdate.put("set", "foo");
doc.addField("id", "test_123");
doc.addField("description", partialUpdate);

yields this document:

<doc boost="1.0">
    <field name="id">test_123</field>
    <field name="description" update="set">foo</field>
</doc>

In this example I used the word “set” for this additional attribute, but it doesn’t work.
Solr doesn’t update the field as I expected.
According to this link:
http://solr.pl/en/2012/07/09/solr-4-0-partial-documents-update/
valid values are “set” and “add”.

Any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T00:50:17+00:00Added an answer on June 11, 2026 at 12:50 am

    As it turns out, the code snippet shown above in the question actually works. I don’t know what was wrong the first time I tried it, perhaps I simply forgot to commit or my schema was misconfigured.

    In any case, this question is very localized. However, since the api with the hash map is so poorly documented, I thought maybe it is worth to keep this question and answer.

    The key of the hash map can be one of three values:

    • set – to set a field.
    • add – to add to a multi-valued field.
    • inc – to increment a field.

    There is an example of this code in the solrj unit tests, in a method called testUpdateField.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I implemented Solr SpellCheck Component based on the document from http://wiki.apache.org/solr/SpellCheckComponent , it works
We are using solr version 3.5 to search though Tweets, I am using WordDelimiterFactory
solr sort,i want Specify a particular document at the first for example: Results :
Have Solr document: <doc> <field name=name>El Chikilin De MaZaTlAn Sin</field> <field name=imageUrl>http://a4.l3-images.myspacecdn.com/images02/113/d4b1567ba13b46309335f9160dc56206/m.jpg</field> <field name=Sex>M</field>
Apache Solr came up in a discussion today, it seems it has the unique
I have a Solr installation that contains recipes. Each recipe has multiple ingredients and
I'm using solr version 1.4.0 with tomcat 6. I've 2 solr instances running as
Does solr allow updating specific field rather than indexing entire document. I know solr
I'm trying to setup Solr 3.6.0 with Django-haystack Beta 2.0.0. After running ./manage.py build_solr_schema
In Solr I have a custom Analyzer that has two parameters. I know how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.