[hibernate-dev] [HSEARCH-670] Add indexNullAs to @IndexedEmbedded

Davide D'Alto daltodavide at gmail.com
Fri Aug 12 06:59:19 EDT 2011


Hello,
I've created a prototype for HSEARCH-670:
https://github.com/DavideD/hibernate-search/commits/HSEARCH-670

It seems to work but I'm not sure about the options to use indexing
the null value.
At the moment it uses the following LucenOption object:

LuceneOptions options = new LuceneOptionsImpl(
					Store.YES,
					org.apache.lucene.document.Field.Index.ANALYZED,
					org.apache.lucene.document.Field.TermVector.NO,
					1F );

And I use the following default TwoWayStringBridge:

TwoWayStringBridge fb = new TwoWayStringBridge() {
				
				@Override
				public String objectToString(Object object) {
					return nullMarker;
				}
				
				@Override
				public Object stringToObject(String stringValue) {
					return null;
				}
			};

This is the method:
https://github.com/DavideD/hibernate-search/commit/52a9280321e6ea06ff8324275ac7e0db55dab16b#L2R576

Do they make sense?

Cheers,
Davide



More information about the hibernate-dev mailing list