Commit cf0dd2c0d7c81bdb78cd0d06705edee65eadac1b
1 parent
9602148c
KTS-673
"The search algorithm needs some work" Updated. Committed By: Conrad Vermeulen Reviewed By: Kevin Fourie git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7474 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
14 additions
and
2 deletions
search2/indexing/extractorCore.inc.php
| ... | ... | @@ -124,10 +124,22 @@ abstract class DocumentExtractor |
| 124 | 124 | } |
| 125 | 125 | $classname=get_class($this); |
| 126 | 126 | |
| 127 | + $sql = "select id as extractor_id from mime_extractors WHERE name='$classname'"; | |
| 128 | + $rs = DBUtil::getResultArray($sql); | |
| 129 | + if (count($rs) == 0) | |
| 130 | + { | |
| 131 | + $extractor_id = DBUtil::autoInsert('mime_extractors', array('name'=>$classname, 'active'=>1)); | |
| 132 | + } | |
| 133 | + else | |
| 134 | + { | |
| 135 | + $extractor_id = $rs[0]['extractor_id']; | |
| 136 | + } | |
| 137 | + | |
| 138 | + | |
| 127 | 139 | foreach($types as $type) |
| 128 | 140 | { |
| 129 | - $sql = "update mime_types set extractor='$classname' where mimetypes='$type' and extractor is null"; | |
| 130 | - DBUtil::runQuery($sql); | |
| 141 | + $sql = "update mime_types set extractor_id=$extractor_id where mimetypes='$type' and extractor_id is null"; | |
| 142 | + $rs = DBUtil::runQuery($sql); | |
| 131 | 143 | } |
| 132 | 144 | } |
| 133 | 145 | ... | ... |