search::content_filter (private)

 search::content_filter [ -passing_style passing_style ] _txt _data \
    mime

Defined in packages/search/tcl/search-procs.tcl

Switches:
-passing_style (optional, defaults to "string")
Parameters:
_txt (required)
_data (required)
mime (required)
Author:
Neophytos Demetriou

Partial Call Graph (max 5 caller/called nodes):
%3 search::content_get search::content_get (private) search::content_filter search::content_filter search::content_get->search::content_filter ad_opentmpfile ad_opentmpfile (public) search::content_filter->ad_opentmpfile search::convert::binary_to_text search::convert::binary_to_text (public) search::content_filter->search::convert::binary_to_text

Testcases:
No testcase defined.
Source code:
    upvar $_txt txt
    upvar $_data data

    #ns_log notice "---search::content_filter $mime data=[string length $data] <$passing_style>"

    if {$passing_style eq "string"} {
        if {[string match text/* $mime]} {
            if {$mime eq "text/html"} {
                set txt [ns_striphtml $data]
            } else {
                set txt $data
            }
            return
        }
        #
        # Write content to a file and let the filter below extract the
        # words for the index from the file.
        #
        set f [ad_opentmpfile tmp_filename]
        puts $f $data
        close $f
        set data $tmp_filename
    }

    set txt [search::convert::binary_to_text -filename $data -mime_type $mime]
    #ns_log notice "search::content_filter txt len [string length $txt]"

    if {[info exists tmp_filename]} {
        file delete -- $tmp_filename
    }
XQL Not present:
PostgreSQL
Generic XQL file:
packages/search/tcl/search-procs.xql

Oracle XQL file:
packages/search/tcl/search-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: