BTW, the Search API chapter in the Search Developer's Guide describes the extension mechanism here:
http://docs.marklogic.com/4.2doc/docapp.xqy#display.xqy?fname=http://pubs/4.2doc/xml/search-dev-guide/search-api.xml%2328383 -Danny -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Danny Sokolsky Sent: Friday, February 25, 2011 5:15 PM To: General MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] Special elements in Snippets Hi Will, I would not modify the source directly. Instead, you can use the search API's extension mechanism to create your own function, stored in your own environment (ie, in your App Server root), and use the apply attribute of search:transform-results. Then you can start by copying the code from the search API, if you wish. The reason you should not modify the search API code directly is that it will get overridden upon upgrade of MarkLogic Server. For example, if you have a library called my-library.xqy in your App Server root, you can add this option to your search:options node: <transform-results apply="snippet" ns="my-namespace" at="/my-library.xqy"/> Then it will use the snippet function from your library instead of the built-in one. -Danny -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Will Thompson Sent: Friday, February 25, 2011 4:05 PM To: [email protected] Subject: [MarkLogic Dev General] Special elements in Snippets Hello all, Search:snippet does almost everything I need, and in lieu of starting from scratch with another snippet library for one feature, I'm considering modifying the source of snippet.xqy. I need certain elements to be passed through to the snippet without being converted to text so they can be styled correctly when the snippet is transformed into HTML. I also want to ignore these elements when highlighting. Other than this the API is ideal, and it seems like a waste to start from scratch for just one feature. Does anyone have any comments about modifying the Search API source? Or if there is possibly a 3rd way to go about this that I'm not considering? Thanks, Will Thompson Jones McClure Publishing 713.335.8247 _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
