[opencms-dev] Index an XmlContent element - Boolean fields

Juan Francisco Fernández juanffernandez at faffe.es
Wed Apr 9 09:42:10 CEST 2008


I got an error from email Server, so I don't know if this email was sent
properly to the list, resending it:

-------------

Hi Steve (and list),

This could be a solution, and also I have done another work-around: I have
defined the field as string and then I mapped it to BooleanWidget, so you
can operate with it as usual:

<xsd:sequence>
     .....
     <xsd:element name="ElementName" type="OpenCmsString" />
</xsd:sequence>

<layouts>
     .....
     <layout element="ElementName" widget="BooleanWidget" />
</layouts>

I don’t know if there is a better way than this two solutions, any tip is
welcomed :).


-----Mensaje original-----
De: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org]
En nombre de Steve Bryan
Enviado el: viernes, 04 de abril de 2008 16:28
Para: opencms-dev at opencms.org
Asunto: Re: [opencms-dev] Index an XmlContent element - Boolean fields

Hi Juan

I also found a problem with searching Boolean elements in xml content - it
just didn't seem to work. Perhaps this is a bug OpenCms developers???

The work-around I have found is to map the boolean elements to properties in
the XML schema, eg
<xsd:annotation> 
  	<xsd:appinfo> 
		<mappings>
			<mapping element="ABoolean"
mapto="property:ABoolean" />
		</mappings>
	</xsd:appinfo> 
  </xsd:annotation>  

Then map the property to the lucene field

    <field name="ABoolean" store="true" index="true">
       <mapping type="property">ABoolean</mapping>
    </field>

The downside of this is that it leads to lots of new un-necessary properties
being defined.

Steve

-----Original Message-----

Date: Thu, 3 Apr 2008 17:00:02 +0200
From: Juan Francisco Fern?ndez <juanffernandez at faffe.es>
Subject: Re: [opencms-dev] Index an XmlContent element
To: "'The OpenCms mailing list'" <opencms-dev at opencms.org>
Message-ID: <000c01c8959b$64fb00e0$b000a8c0 at faffe.es>
Content-Type: text/plain;	charset="iso-8859-1"

Well, now it works well for String fields in xml content, but how I
search/index Boolean fields? I have tried to search as the text items, but
it doesnt find anything.

Thanks.





_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev




More information about the opencms-dev mailing list