*** JUNK MAIL ***Re: [opencms-dev] search xmlcontent

Detlef Beyer d.beyer at crash.de
Thu Apr 26 17:15:47 CEST 2007


Hi Claus,

thanks for your reply!

So I need to build my own CmsVfsIndexer class and a new A_CmsIndexResource class and then change opencms-search.xml to something like this:

            <indexsource>
                <name>source1</name>
                <indexer class="org.opencms.search.MyVfsIndexer"/>
                <resources>
                    <resource>/sites/default/</resource>
                </resources>
                <documenttypes-indexed>
                    <name>xmlcontent</name>
                </documenttypes-indexed>
            </indexsource>

(the configuration is the easy part IMHO)...????

I can not switch to the openCms 7 beta now - would it be a good idea to look into the new stuff there and try to build my own openCms class based on what I find there?

Again - thanks a lot for the advice.

Detlef

>The first step is to make sure the Lucene index actually support the kind of query you want to make. I.e. the contents of the specific tags from your xmlcontent must be present in a separate Lucene index field. Per default OpenCms extracts all text from the contents and put into the contents field in the Lucene index, so you cannot limit the search to only look at specific parts of the xmlcontens.
>
>In v. 6 this means creating a new class for handling the indexing of the specific types of xmlcontents (and set it in the opencms-search.xml).
>In v. 7 you can map fields via the configuration, so you can most likely avoid the step of making a specific class for the indexing (unless you have explicit needs as far as controlling exactly how each field is analyzed, tokenized, indexed...)
>
>Once the Lucene index holds the appropriate information then you must define your query such that it only looks at the appropriate fields (instead of the generic contents field).
>
>This is mostly Lucene stuff, the OpenCms API hides some of the OpenCms specifics, but you'll need to have an idea of how Lucene works.
>
>Detlef Beyer wrote:
>>Hello again!
>>
>>nobody has an idea how to solve this problem? I checked the forum and mail archive and found no solution?!
>>There must be a way to limit the lucene search to specific fields of the xml documents... :(
>>
>>Please!
>>
>>Detlef
>>
>>>I'm trying to limit a search in xmlcontent files to include only some of the elements (fields) of my custom XML types. Searching only xmlcontent works - but the result includes all fields.
>>>I found no way to use the opencms-search.xml for the configuration of this feature. I defined an indexsource with the documenttype "xmlcontent" - but there is no entry to specify the fields to search in?!
>>
>>_______________________________________________
>>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
>>
>
>--
>Claus Priisholm, CodeDroids ApS
>Phone: +45 48 22 46 46
>cpr (you know what) codedroids.com - http://www.codedroids.com
>cpr (you know what) interlet.dk - http://www.interlet.dk
>--
>Javadocs and other OpenCms stuff: http://www.codedroids.com/community/opencms
>
>_______________________________________________
>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