Page 1 of 1

how to exclude topics from webhelp search

Posted: Thu Jul 30, 2015 4:20 pm
by mark_whisler
We have a large help system which contains thousands of error/info/warning messages. I'd like to be able to exclude or restrict search on those. Does oXygen webhelp support the following use in the topicref?

Code: Select all

<topicref search="no" toc="no" href="bla/bla.msg"/>
Is it possible to limit or filter search to a standard element within a topic, such as an id?

Thanks

Re: how to exclude topics from webhelp search

Posted: Mon Aug 03, 2015 10:08 am
by bogdan_cercelaru
Hello,

Unfortunately Oxygen WebHelp does not have implemented the use of "search" attribute to filter the topics included in the search results of WebHelp output.
mark_whisler wrote:Is it possible to limit or filter search to a standard element within a topic, such as an id?
You should use a custom build file and override the "webhelp-index" target from the OXYGEN_DIR\frameworks\dita\DITA-OT\plugins\com.oxygenxml.webhelp\build_common.xml file. Add the identifier of the elements that you want to be filtered to the "doNotIndex" attribute of the "indexertask" element.
Your custom build file should look like:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="dist">

<!-- Create the JavaScript files with the search database. -->
<target name="webhelp-index" depends="check-list">
<taskdef name="indexertask" classname="ro.sync.exml.indexer.IndexerTask"/>
<echo>Indexing html files in ${output.dir}, indexer language is: ${webhelp.language}</echo>
<indexertask
htmlDir="${output.dir}"
resourcesDir="${output.dir}/oxygen-webhelp"
outputDir="${output.dir}/oxygen-webhelp/search"
propsDir="indexer"
indexerLanguage="${webhelp.language}"
htmlExtension="${args.outext}"
stem="${use.stemming}"
userDictionary="${webhelp.search.japanese.dictionary}"
doNotIndex="div.ignore,div.navfooter,div.footer,div.navheader"/>
</target>

<!--The DITA OT default build file-->
<import file="build.xml"/>

<target name="dist">
<!--Call the DITA OT default target-->
<antcall target="init"/>
</target>
</project>
Here you can find more details about using a custom build file: Author for DITA / DITA-OT Customization / Using Your Custom Build File

Regards,
Bogdan