Vineel Nalla
Vineel Nalla

Reputation: 83

updating solr document using a query?

In the solr documentation, there are options to delete documents using a query, something like the following:

<delete><query>*:*</query></delete>
<delete><query>id:298253</query>
<query>entitytype:BlogEntry</query></delete>

However, I could not find any references about updating documents based on a query. Is this possible with updates in solr? Basically I would like to update the values of all the documents that match a query.

Something like update prop1=val1, prop2=val2 where ( prop3 < val3 and prop4=val4 )

Thanks,
-Vineel

Upvotes: 3

Views: 954

Answers (2)

Okke Klein
Okke Klein

Reputation: 2549

Keep in mind that for partially updating documents in Solr, they need to be stored. Which increases the index size. Check this for some background

Upvotes: 1

Paige Cook
Paige Cook

Reputation: 22555

The ability to update documents is being added to the Solr 4.0 release, which just went into Beta this week. I am not sure if there will be the ability to update documents based on a query, but you could ask in the Solr Users List. Unfortunately, I have not had a chance to explore the 4.0 version yet to see how atomic updates work.

Upvotes: 1

Related Questions