Hi Simon,

You can index an empty field ("" value), but there is no point in doing that, 
really.
If you index am empty string, you will not be able to find documents that had 
that field empty.
You will not be able to do a WHERE foo IS NULL type of query, unless you detect 
an empty field during indexing, and put a dummy value it in instead of am empty 
string.

Otis

----- Original Message ----
From: Simon Willnauer <[EMAIL PROTECTED]>
To: java-user@lucene.apache.org
Sent: Monday, July 31, 2006 1:11:22 PM
Subject: Re: Index empty fields

Hi Otis,

well if i have to such a query I need a "dummy" value. To point that
out a bit more in detail...
A xml document has "n" mandatory elements described by a schema or
dtd. Some of the could have empty values. Would it make any difference
to the index / searching  if I just index an empty string?! Well I
guess not, to index an empty string feels good for me to have all
fields in every document. This tiny little disc space does not matter
I guess.

Is that true so far?!

regards Simon

On 7/31/06, Otis Gospodnetic <[EMAIL PROTECTED]> wrote:
> Hi Simon,
>
> If you want to be able to run a "give me all documents that have an empty 
> field F", then you'll actually have to stuff a "dummy" value when no real 
> value for field F is present.  If you have an index schema, perhaps that's a 
> good place to add a 'defaultValue'-type attribute with that dummy value.  
> Perhaps Solr already has something like this, I'm not sure.
>
> Otis
>
> ----- Original Message ----
> From: Simon Willnauer <[EMAIL PROTECTED]>
> To: java-user@lucene.apache.org
> Sent: Monday, July 31, 2006 8:22:57 AM
> Subject: Index empty fields
>
> Hello,
>
> I do have a question about fields with empty content should be added
> to the document / index or not. I do have a index schema, which
> defines all field a document can have. if one of the real documents
> has no content for a certain field. should that field be added to the
> index or not.
> Would it make any difference at all?
>
> regards Simon
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to