[opencms-dev] bug in opencms-lucene module - when the DB is case sensitive
Ernesto De Santis
ernesto.desantis at colaborativa.net
Tue Mar 2 21:18:01 CET 2004
Hello
We found a bug in the opencms-lucene module. When reading several properties from the OpenCms VFS, the module is using lowercase hardcoded strings and Opencms defines constants with uppercase. This is causing the related fields to be indexed with null values
The bug is in this three if sentences in BodylessDocument, method Document.
if((title = cmso.readProperty(absPath, "title")) != null) {
doc.add(Field.Text(FIELD_TITLE, title));
doc.add(Field.UnStored(FIELD_BULK, title));
}
if((description = cmso.readProperty(absPath, "description")) != null) {
doc.add(Field.Text(FIELD_DESC, description));
doc.add(Field.UnStored(FIELD_BULK, description));
}
if((keywords = cmso.readProperty(absPath, "keywords")) != null) {
doc.add(Field.Text(FIELD_KEYWORDS, keywords));
doc.add(Field.UnStored(FIELD_BULK, keywords));
}
and OpenCms in I_CmsConstants interface, define:
static final String C_PROPERTY_TITLE = "Title"; //Note: "Title"
The best practice is to use the same constants, and we shall be happy. ;-)
Need change to: I_CmsConstants.C_PROPERTY_TITLE, I_CmsConstants.C_PROPERTY_DESCRIPTION, I_CmsConstants.C_PROPERTY_KEYWORDS
Bye
Ernesto.
colaborativa.net
Rosario - Argentina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20040302/30670b1b/attachment.htm>
More information about the opencms-dev
mailing list