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 Vannia Rajan <kv...@gmail.com> on 2008/12/17 13:39:22 UTC

Getting Field(s) Information If I have Unique Key Field-Value or the corresponding Doc Number

Hi,
I need to resolve the following issue:

 I need to get the Value of all the FIELDS defined in solrconfig.xml when i
have the Value of the Unique-Key-Field or the corresponding Doc Number. I
require this because, we need to find the value of a particular field, if a
document is Duplicated.

*Problem, in detail:*
*I browsed through the code of DirectUpdateHandler2.java, where i found that
doDeletions() [as per version 1.2] does the part of deleting duplicate
entries before a COMMIT. I need to get the field-value(s) of the entries
that are going to be deleted because of a duplication, while i have access
only to Doc-number or Unique-key-field-value through
DirectUpdateHandler2.java
*
*I just require the classes/methods used to get the values of other
fields... given the doc-number...*

Thanks in advance
-- 
With Regards,
K.Vanniarajan

Re: Getting Field(s) Information If I have Unique Key Field-Value or the corresponding Doc Number

Posted by Chris Hostetter <ho...@fucit.org>.
:  I need to get the Value of all the FIELDS defined in solrconfig.xml when i
: have the Value of the Unique-Key-Field or the corresponding Doc Number. I
: require this because, we need to find the value of a particular field, if a
: document is Duplicated.

fields aren't definted in solrconfig.xml, they are defined in schema.xml  
and if you have the uniqueKey or docid of a document you can use the 
SolrIndexSearcher to retrieve it.

But let's back up a step, or two, or maybe even 10 ....

: *Problem, in detail:*
: *I browsed through the code of DirectUpdateHandler2.java, where i found that
: doDeletions() [as per version 1.2] does the part of deleting duplicate
: entries before a COMMIT. I need to get the field-value(s) of the entries
: that are going to be deleted because of a duplication, while i have access
: only to Doc-number or Unique-key-field-value through
: DirectUpdateHandler2.java

...that doesn't really explain your problem.  what i'm reading there is 
that you're looking at deletion code and for some reason related to 
"duplication" (of what i'm not sure .. duplicate documents?) you want to 
retrieve the fields of a doc about to be deleted.

that still doesn't tell us what it is you are trying to do, or why...

http://people.apache.org/~hossman/#xyproblem
XY Problem

Your question appears to be an "XY Problem" ... that is: you are dealing
with "X", you are assuming "Y" will help you, and you are asking about "Y"
without giving more details about the "X" so that we can understand the
full issue.  Perhaps the best solution doesn't involve "Y" at all?
See Also: http://www.perlmonks.org/index.pl?node_id=542341



-Hoss