You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Omar Didi <od...@Cyveillance.com> on 2005/04/21 02:05:53 UTC

fields that are indexed as UnStored

Hi guys,

If a field is indexed as UnStored how can I get it value?
I tried document.get("UnStored_field") it returns null.

thanks

-----Original Message-----
From: Kevin L. Cobb [mailto:cobbk@emergint.com]
Sent: Wednesday, April 20, 2005 8:52 AM
To: java-user@lucene.apache.org
Subject: RE: Best way to purposely corrupt an index?


My policy on this type of exception handling is to only byte off what
you can chew. If you catch an IOException, then you simply report to the
user that an unexpected error has occurred and the search engine is
unobtainable at the moment. Errors should be logged and developers
should look at the specifics of the error to solve the issue. As you
implied, either it's a corrupted index, a permission problem, or another
access problem. 

Trying to attack the issue much deeper than this will sacrifice
development/maintenance time for very little payback in the end if you
expect this error to occur infrequently. 



-----Original Message-----
From: Andy Roberts [mailto:mail@andy-roberts.net] 
Sent: Wednesday, April 20, 2005 5:43 AM
To: java-user@lucene.apache.org
Subject: Re: Best way to purposely corrupt an index?

On Wednesday 20 Apr 2005 08:27, Maik Schreiber wrote:
> > As the index is rather critical to my program, I just wanted to make
it
> > really robust, and able to cope should a problem occur with the
index
> > itself. Otherwise, the user will be left with a non-functioning
program
> > with no explanation. That's my reasoning anyway.
>
> You should perhaps go about implementing an automatic index backup
feature
> of some sort. In the case of index corruption you would at least be
able to
> go back to the latest backup.

Don't worry, I know what I intend to do *should* an error exist. My
original 
post was about how to detect corrupt indexes, and also how to purposely 
corrupt an index for the purposes of testing.

Note, IndexReader throws IOExceptions, but, this could be for a
multitude of 
reasons, not just a corrupt index. I was rather hoping for a 
CorruptIndexException of some sort!

It looks to me that if I do get an IOException, I will then have to
perform a 
number of additional checks to eliminate the other possible causes of 
IOExceptions (such as permissions issues), and by a process of
elimination, 
determine a corrupt index.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: fields that are indexed as UnStored

Posted by Andrzej Bialecki <ab...@getopt.org>.
Chuck Williams wrote:
> Omar Didi writes (4/20/2005 5:05 PM):
> 
>> Hi guys,
>>
>> If a field is indexed as UnStored how can I get it value?
>> I tried document.get("UnStored_field") it returns null.
>>  
>>
> You didn't store it, so it's not there.  If the field happens to be a 
> single Term, you might be able to find it in the index, expensively.  If 
> not, it ranges from difficult to impossible.

Please also see the function "Reconstruct & Edit" in Luke 
(http://www.getopt.org/luke) and see if it's enough to meet your 
requirements. The source code is available at the same place.


-- 
Best regards,
Andrzej Bialecki
  ___. ___ ___ ___ _ _   __________________________________
[__ || __|__/|__||\/|  Information Retrieval, Semantic Web
___|||__||  \|  ||  |  Embedded Unix, System Integration
http://www.sigram.com  Contact: info at sigram dot com


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: fields that are indexed as UnStored

Posted by Chuck Williams <ch...@allthingslocal.com>.
Omar Didi writes (4/20/2005 5:05 PM):

>Hi guys,
>
>If a field is indexed as UnStored how can I get it value?
>I tried document.get("UnStored_field") it returns null.
>  
>
You didn't store it, so it's not there.  If the field happens to be a 
single Term, you might be able to find it in the index, expensively.  If 
not, it ranges from difficult to impossible.

Chuck


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org