You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Adam Duston <ad...@gmail.com> on 2011/06/14 16:33:52 UTC

Updating only one indexed field for all documents quickly.

We are updating one indexed integer field in Solr for all documents
once every two hours. We're using Solr through Haystack so we're not
exactly Solr experts. Is there a way to update just one indexed field
for all documents without reindexing all other fields also? We saw
this blog post [1], which appears to be one solution.

Adam

[1] http://sujitpal.blogspot.com/2011/05/custom-sorting-in-solr-using-external.html

-- 
aduston@gmail.com
312-375-9879
Skype: aduston

Re: Updating only one indexed field for all documents quickly.

Posted by karthik <km...@gmail.com>.
Look at solr-2272. It might help in your situation. you can have a separate
core & join using the document unique id.

This way in the separate core you can just have the document id & the view
stats & you can just keep updating those 2 fields alone instead of the
entire document.

-- karthik

On Tue, Jun 14, 2011 at 2:41 PM, Adam Duston <ad...@gmail.com> wrote:

> Hi Erick,
>
> Thanks for your message.
>
> > What is the use-case you're considering?
>
> The use case is actually quite similar to the one in the blog post. We
> have view counts for Videos in our mysql database. We want to be able
> to find "most viewed videos" that match certain search criteria. So,
> for example, videos that contain a particular word and were also
> viewed the greatest number of times.
>
> We keep track of the view statistics in real-time using Redis, and
> then we dump the view stats into mysql once every 2 hours. It takes a
> while to update the solr search index, so we don't want to update the
> entire index once every 2 hours.
>
> > with the integer field. If you just want to influence the
> > score, then just plain external field fields should work for
> > you.
>
> Is this an appropriate solution, give our use case?
>
> Thank you again,
> Adam
>
>
> On Tue, Jun 14, 2011 at 2:36 PM, Erick Erickson <er...@gmail.com>
> wrote:
> > Nope, there isn't a way to index a single field, it's always
> > the entire document.
> >
> > That said, the URL you pointed to is very interesting, but
> > it may be overkill depending upon what you want to do
> > with the integer field. If you just want to influence the
> > score, then just plain external field fields should work for
> > you.
> >
> > What is the use-case you're considering?
> >
> > Best
> > Erick
> >
> > On Tue, Jun 14, 2011 at 10:33 AM, Adam Duston <ad...@gmail.com> wrote:
> >> We are updating one indexed integer field in Solr for all documents
> >> once every two hours. We're using Solr through Haystack so we're not
> >> exactly Solr experts. Is there a way to update just one indexed field
> >> for all documents without reindexing all other fields also? We saw
> >> this blog post [1], which appears to be one solution.
> >>
> >> Adam
> >>
> >> [1]
> http://sujitpal.blogspot.com/2011/05/custom-sorting-in-solr-using-external.html
> >>
> >> --
> >> aduston@gmail.com
> >> 312-375-9879
> >> Skype: aduston
> >>
> >
>
>
>
> --
> aduston@gmail.com
> 312-375-9879
> Skype: aduston
>

Re: Updating only one indexed field for all documents quickly.

Posted by Alexey Serba <as...@gmail.com>.
>> with the integer field. If you just want to influence the
>> score, then just plain external field fields should work for
>> you.
>
> Is this an appropriate solution, give our use case?
>
Yes, check out ExternalFileField

* http://search.lucidimagination.com/search/document/CDRG_ch04_4.4.4
* http://lucene.apache.org/solr/api/org/apache/solr/schema/ExternalFileField.html
* http://www.slideshare.net/greggdonovan/solr-lucene-etsy-by-gregg-donovan/28

Re: Updating only one indexed field for all documents quickly.

Posted by Adam Duston <ad...@gmail.com>.
Hi Erick,

Thanks for your message.

> What is the use-case you're considering?

The use case is actually quite similar to the one in the blog post. We
have view counts for Videos in our mysql database. We want to be able
to find "most viewed videos" that match certain search criteria. So,
for example, videos that contain a particular word and were also
viewed the greatest number of times.

We keep track of the view statistics in real-time using Redis, and
then we dump the view stats into mysql once every 2 hours. It takes a
while to update the solr search index, so we don't want to update the
entire index once every 2 hours.

> with the integer field. If you just want to influence the
> score, then just plain external field fields should work for
> you.

Is this an appropriate solution, give our use case?

Thank you again,
Adam


On Tue, Jun 14, 2011 at 2:36 PM, Erick Erickson <er...@gmail.com> wrote:
> Nope, there isn't a way to index a single field, it's always
> the entire document.
>
> That said, the URL you pointed to is very interesting, but
> it may be overkill depending upon what you want to do
> with the integer field. If you just want to influence the
> score, then just plain external field fields should work for
> you.
>
> What is the use-case you're considering?
>
> Best
> Erick
>
> On Tue, Jun 14, 2011 at 10:33 AM, Adam Duston <ad...@gmail.com> wrote:
>> We are updating one indexed integer field in Solr for all documents
>> once every two hours. We're using Solr through Haystack so we're not
>> exactly Solr experts. Is there a way to update just one indexed field
>> for all documents without reindexing all other fields also? We saw
>> this blog post [1], which appears to be one solution.
>>
>> Adam
>>
>> [1] http://sujitpal.blogspot.com/2011/05/custom-sorting-in-solr-using-external.html
>>
>> --
>> aduston@gmail.com
>> 312-375-9879
>> Skype: aduston
>>
>



-- 
aduston@gmail.com
312-375-9879
Skype: aduston

Re: Updating only one indexed field for all documents quickly.

Posted by Erick Erickson <er...@gmail.com>.
Nope, there isn't a way to index a single field, it's always
the entire document.

That said, the URL you pointed to is very interesting, but
it may be overkill depending upon what you want to do
with the integer field. If you just want to influence the
score, then just plain external field fields should work for
you.

What is the use-case you're considering?

Best
Erick

On Tue, Jun 14, 2011 at 10:33 AM, Adam Duston <ad...@gmail.com> wrote:
> We are updating one indexed integer field in Solr for all documents
> once every two hours. We're using Solr through Haystack so we're not
> exactly Solr experts. Is there a way to update just one indexed field
> for all documents without reindexing all other fields also? We saw
> this blog post [1], which appears to be one solution.
>
> Adam
>
> [1] http://sujitpal.blogspot.com/2011/05/custom-sorting-in-solr-using-external.html
>
> --
> aduston@gmail.com
> 312-375-9879
> Skype: aduston
>