lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: IFilter
Date Wed, 30 Apr 2003 18:35:29 GMT
On Tuesday, April 29, 2003, at 08:25  PM, Kelvin Tan wrote:
> Sorry. Its a casual abuse of the phrase "magic numbers". In other 
> words, I
> favour
> Map m = aHTMLFilter.getMetadata();
> doc.add(Field.Text(HTMLFilter.TITLE, (String) 
> m.get(HTMLFilter.TITLE)));
> versus
> doc.add(Field.Text("title", (String) m.get("title)));
> It may not seem significant if all you're going to do with the map is 
> iterate
> over the keyset and add each entry as a field, but I don't think its 
> good
> practice in any event.

I was thinking of doing the iterate and just blindly adding all entries 
in the Map to a Document as fields.  But this brings up an issue that 
actually will make the Metadata object necessary - what type are the 
fields in the map?  Text?  Keyword?  Date?  Should they be indexed?  
Tokenized?  Stored?  Should the underlying document handler make these 

With your first example, though, the document handler implementation is 
now important at the parent level, whereas I was aiming for something 
more generic.

These issues shed light on why this hasn't been done before and why it 
may not be something that can (or should) be done generically with a 
simple interface.  There are a lot of domain-specific issues that can 
crop up.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message