|
16.1 <Profiler> and LIKEIN - How to use |
|
The two features in Texis that support profiling are the <profiler> function in Vortex, and the LIKEIN query in the SQL engine. The LIKEIN query in the SQL engine takes a query, and finds those records with a matching field. An example in Vortex would be:
<SQL ROW "SELECT id FROM queries WHERE query LIKEIN $doc">
<processresult>
</SQL>
|
The <profiler> function in Vortex is used to generate a more efficient query. The raw document that is received may contain many words that are not in any query, or have the same word repeated many times. The <profiler> function extracts the required portions of the document and generates a more appropriate query. The initial setup of the profiler can be expensive, so the program that is doing the profiling should stay running, and keep the profiler initialized. A typical profiler application would have code similar to:
<profiler INIT queries prof query>
<while 1 eq 1>
<getdocument>
<$doc=$ret>
<profiler GET $doc prof>
<SQL ROW "SELECT id FROM queries WHERE query LIKEIN $ret">
<processresult>
</SQL>
</while>
|