Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
315
Merge Requests
315
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
854fa41f
Commit
854fa41f
authored
Jan 11, 2005
by
Steven Wittens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fixing duplicate rows error during indexing
- Fixing broken "pagerank" detection
parent
59a2c464
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
modules/search.module
modules/search.module
+6
-2
modules/search/search.module
modules/search/search.module
+6
-2
No files found.
modules/search.module
View file @
854fa41f
...
...
@@ -181,7 +181,11 @@ function search_cron() {
$total
=
db_result
(
db_query
(
"SELECT SUM(score) FROM
{
search_index
}
WHERE word = '%s'"
,
$word
));
db_query
(
"UPDATE
{
search_total
}
SET count = %d WHERE word = '%s'"
,
$total
,
$word
);
if
(
!
db_affected_rows
())
{
db_query
(
"INSERT INTO
{
search_total
}
(word, count) VALUES ('%s', %d)"
,
$word
,
$total
);
// Note: affected rows does not count matching rows that already had the right value!
$exists
=
db_result
(
db_query
(
"SELECT COUNT(*) FROM
{
search_total
}
WHERE word = '%s'"
,
$word
));
if
(
!
$exists
)
{
db_query
(
"INSERT INTO
{
search_total
}
(word, count) VALUES ('%s', %d)"
,
$word
,
$total
);
}
}
}
// Find words that were deleted from search_index, but are still in
...
...
@@ -331,7 +335,7 @@ function search_index($sid, $type, $text) {
// Check if link points to a node on this site
if
(
preg_match
(
$node_regexp
,
$value
,
$match
))
{
$path
=
drupal_get_normal_path
(
$match
[
1
]);
if
(
preg_match
(
'!(node|book)/(?:view/)?([0-9]+)!i'
,
$path
,
$match
))
{
if
(
preg_match
(
'!(
?:
node|book)/(?:view/)?([0-9]+)!i'
,
$path
,
$match
))
{
$linknid
=
$match
[
1
];
if
(
$linknid
>
0
)
{
$link
=
true
;
...
...
modules/search/search.module
View file @
854fa41f
...
...
@@ -181,7 +181,11 @@ function search_cron() {
$total
=
db_result
(
db_query
(
"SELECT SUM(score) FROM
{
search_index
}
WHERE word = '%s'"
,
$word
));
db_query
(
"UPDATE
{
search_total
}
SET count = %d WHERE word = '%s'"
,
$total
,
$word
);
if
(
!
db_affected_rows
())
{
db_query
(
"INSERT INTO
{
search_total
}
(word, count) VALUES ('%s', %d)"
,
$word
,
$total
);
// Note: affected rows does not count matching rows that already had the right value!
$exists
=
db_result
(
db_query
(
"SELECT COUNT(*) FROM
{
search_total
}
WHERE word = '%s'"
,
$word
));
if
(
!
$exists
)
{
db_query
(
"INSERT INTO
{
search_total
}
(word, count) VALUES ('%s', %d)"
,
$word
,
$total
);
}
}
}
// Find words that were deleted from search_index, but are still in
...
...
@@ -331,7 +335,7 @@ function search_index($sid, $type, $text) {
// Check if link points to a node on this site
if
(
preg_match
(
$node_regexp
,
$value
,
$match
))
{
$path
=
drupal_get_normal_path
(
$match
[
1
]);
if
(
preg_match
(
'!(node|book)/(?:view/)?([0-9]+)!i'
,
$path
,
$match
))
{
if
(
preg_match
(
'!(
?:
node|book)/(?:view/)?([0-9]+)!i'
,
$path
,
$match
))
{
$linknid
=
$match
[
1
];
if
(
$linknid
>
0
)
{
$link
=
true
;
...
...
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