diff options
author | unknown <serg@serg.mysql.com> | 2001-11-22 16:00:11 +0100 |
---|---|---|
committer | unknown <serg@serg.mysql.com> | 2001-11-22 16:00:11 +0100 |
commit | 198df9007eaaf1aacbdff6c3e6b438bfd013a66c (patch) | |
tree | d6f7c3326335cf1432cad86e47e88950fca45ec9 /myisam | |
parent | 1bdd19639d583cf182731c82eef08a21d2751f5c (diff) | |
download | mariadb-git-198df9007eaaf1aacbdff6c3e6b438bfd013a66c.tar.gz |
fixes for ft-boolean and range optimizer
Diffstat (limited to 'myisam')
-rw-r--r-- | myisam/ft_boolean_search.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c index de9d16e42c8..355a11bc160 100644 --- a/myisam/ft_boolean_search.c +++ b/myisam/ft_boolean_search.c @@ -339,7 +339,7 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record) /* curdoc matched ! */ info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); /* why is this ? */ - /* info->lastpos=curdoc; */ /* do I need this ? */ + info->lastpos=curdoc; if (!(*info->read_record)(info,curdoc,record)) { info->update|= HA_STATE_AKTIV; /* Record is read */ @@ -348,6 +348,7 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record) return my_errno; } } + ftb->state=INDEX_DONE; return my_errno=HA_ERR_END_OF_FILE; } @@ -359,17 +360,33 @@ float ft_boolean_find_relevance(FT_INFO *ftb, my_off_t docid, byte *record) FTB_EXPR *ftbe; uint i; - if (ftb->state == READY) + if (ftb->state == READY || ftb->state == INDEX_DONE) { + for (i=1; i<=ftb->queue.elements; i++) + { + ftbw=(FTB_WORD *)(ftb->queue.root[i]); + ftbw->docid=HA_POS_ERROR; + for (ftbe=ftbw->up; ftbe; ftbe=ftbe->up) + { + if (ftbe->docid != HA_POS_ERROR) + { + ftbe->cur_weight=ftbe->yesses=ftbe->nos=0; + ftbe->docid=HA_POS_ERROR; + } + else + break; + } + } + queue_fix(& ftb->queue); ftb->state=SCAN; } else if (ftb->state != SCAN) - return -1.0; + return -2.0; bzero(&ptree, sizeof(ptree)); if (_mi_ft_parse(& ptree, ftb->info, ftb->keynr, record)) - return -1.0; + return -3.0; for (i=1; i<=ftb->queue.elements; i++) { |