Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
9c5c6daf
Commit
9c5c6daf
authored
Aug 19, 2003
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-4.0/
into serg.mylan:/usr/home/serg/Abk/mysql-4.0
parents
67301c60
018e7524
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
31 deletions
+8
-31
myisam/ft_nlq_search.c
myisam/ft_nlq_search.c
+8
-31
No files found.
myisam/ft_nlq_search.c
View file @
9c5c6daf
...
...
@@ -67,12 +67,9 @@ static int FT_SUPERDOC_cmp(void* cmp_arg __attribute__((unused)),
static
int
walk_and_match
(
FT_WORD
*
word
,
uint32
count
,
ALL_IN_ONE
*
aio
)
{
uint
keylen
,
r
,
doc_cnt
;
#ifdef EVAL_RUN
uint
cnt
;
double
sum
,
sum2
,
suml
;
#endif
/* EVAL_RUN */
FT_SUPERDOC
sdoc
,
*
sptr
;
TREE_ELEMENT
*
selem
;
double
gweight
=
1
;
#if HA_FT_WTYPE == HA_KEYTYPE_FLOAT
float
tmp_weight
;
#else
...
...
@@ -84,42 +81,27 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
word
->
weight
=
LWS_FOR_QUERY
;
keylen
=
_ft_make_key
(
aio
->
info
,
aio
->
keynr
,(
char
*
)
aio
->
keybuff
,
word
,
0
);
#ifdef EVAL_RUN
keylen
-=
1
+
HA_FT_WLEN
;
#else
/* EVAL_RUN */
keylen
-=
HA_FT_WLEN
;
#endif
/* EVAL_RUN */
#ifdef EVAL_RUN
sum
=
sum2
=
suml
=
#endif
/* EVAL_RUN */
doc_cnt
=
0
;
r
=
_mi_search
(
aio
->
info
,
aio
->
keyinfo
,
aio
->
keybuff
,
keylen
,
SEARCH_FIND
|
SEARCH_PREFIX
,
aio
->
key_root
);
aio
->
info
->
update
|=
HA_STATE_AKTIV
;
/* for _mi_test_if_changed() */
while
(
!
r
)
while
(
!
r
&&
gweight
)
{
if
(
_mi_compare_text
(
aio
->
charset
,
aio
->
info
->
lastkey
,
keylen
,
aio
->
keybuff
,
keylen
,
0
))
break
;
#if HA_FT_WTYPE == HA_KEYTYPE_FLOAT
#ifdef EVAL_RUN
mi_float4get
(
tmp_weight
,
aio
->
info
->
lastkey
+
keylen
+
1
);
#else
/* EVAL_RUN */
mi_float4get
(
tmp_weight
,
aio
->
info
->
lastkey
+
keylen
);
#endif
/* EVAL_RUN */
#else
#error
#endif
if
(
tmp_weight
==
0
)
DBUG_RETURN
(
doc_cnt
);
/* stopword, doc_cnt should be 0 */
#ifdef EVAL_RUN
cnt
=*
(
byte
*
)(
aio
->
info
->
lastkey
+
keylen
);
#endif
/* EVAL_RUN */
sdoc
.
doc
.
dpos
=
aio
->
info
->
lastpos
;
/* saving document matched into dtree */
...
...
@@ -137,11 +119,10 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
sptr
->
tmp_weight
=
tmp_weight
;
doc_cnt
++
;
#ifdef EVAL_RUN
sum
+=
cnt
;
sum2
+=
cnt
*
cnt
;
suml
+=
cnt
*
log
(
cnt
);
#endif
/* EVAL_RUN */
gweight
=
word
->
weight
*
GWS_IN_USE
;
if
(
gweight
<
0
||
doc_cnt
>
2000000
)
gweight
=
0
;
if
(
_mi_test_if_changed
(
aio
->
info
)
==
0
)
r
=
_mi_search_next
(
aio
->
info
,
aio
->
keyinfo
,
aio
->
info
->
lastkey
,
...
...
@@ -152,13 +133,9 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
aio
->
info
->
lastkey_length
,
SEARCH_BIGGER
,
aio
->
key_root
);
}
if
(
doc_cnt
)
{
word
->
weight
*=
GWS_IN_USE
;
if
(
word
->
weight
<
0
)
word
->
weight
=
0
;
}
word
->
weight
=
gweight
;
DBUG_RETURN
(
0
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment