Hi Savannah,

if you *only want to boost* documents based on the information you calculate from the MoreLikeThis results (i.e. numeric measure), you might want to take a look at the ExternalFileField type. This field type reads its contents from a file which contains key-value pairs, e.g. the document ids and the corresponding measure values, resp. If some values change you still have to regenerate the whole file (instead of the whole index). But of course, this file can be generated from a DB, which might be updated incrementally.

For setup and usage e.g. see: http://dev.tailsweep.com/solr-external-scoring/

Zachary

On 10.09.2010 19:57, Savannah Beckett wrote:
I want to do MoreLikeThis to find documents that are similar to the document
that I am indexing.  Then I want to calculate the average of one of the fields
of all those documents and input this average into a field of the document that
I am indexing.  From my research, it seems that MoreLikeThis can only be used to
find similarity of document that is already in the index.  So, I think I need to
index it first, and then use MoreLikeThis to find similar documents in the index
and then reindex that document.  Any better way?  I try not to reindex a
document because it's not efficient.  I don't have to use MoreLikeThis.
Thanks.



________________________________
From: Jonathan Rochkind<rochk...@jhu.edu>
To: "solr-user@lucene.apache.org"<solr-user@lucene.apache.org>
Sent: Fri, September 10, 2010 9:58:20 AM
Subject: RE: How to Update Value of One Field of a Document in Index?

"More like this" is intended to be run at query time. For what reasons are you
thinking you want to (re-)index each document based on the results of
MoreLikeThis?  You're right that that's not what the component is intended for.


Jonathan
________________________________________
From: Savannah Beckett [savannah_becket...@yahoo.com]
Sent: Friday, September 10, 2010 11:18 AM
To: solr-user@lucene.apache.org
Subject: Re: How to Update Value of One Field of a Document in Index?

Thanks.  I am trying to use MoreLikeThis in Solr to find similar documents in
the solr index and use the data from these similar documents to modify a field
in each document that I am indexing.  I found that MoreLikeThis in Solr only
works when the document is in the index, is it true?  If so, I may have to wait
til the indexing is finished, then run my own command to do MoreLikeThis to each
document in the index, and then reindex each document?  It sounds like it's not
efficient.  Is there a better way?
Thanks.




________________________________
From: Liam O'Boyle<liam.obo...@intelligencebank.com>
To: solr-user@lucene.apache.org
Cc: u...@nutch.apache.org
Sent: Thu, September 9, 2010 11:06:36 PM
Subject: Re: How to Update Value of One Field of a Document in Index?

Hi Savannah,

You can only reindex the entire document; if you only have the ID,
then do a search to retrieve the rest of the data, then reindex.  This
assumes that all of the fields you need to index are stored (so that
you can retrieve them) and not just indexed.

Liam

On Fri, Sep 10, 2010 at 3:29 PM, Savannah Beckett
<savannah_becket...@yahoo.com>  wrote:
I use nutch to crawl and index to Solr.  My code is working.  Now, I want to
update the value of one of the fields of a document in the solr index after
the
document was already indexed, and I have only the document id.  How do I do
that?

Thanks.






__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com

Reply via email to