I can't search anything in my serendipity generally.
But sometimes I found that a few things can be searched !
What should I do to make search works well always? Thank you very much!
Does search works in the recent cvs?
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Does search works in the recent cvs?
When does the search work and when not? You need to use words longer than 3 characters and pay attention to special characters.
There are a few threads on this forum about missing MySQL fulltext keys, maybe you search them up and see if your keys are correct. But then again, if your search works "sometimes", that can't be the case.
Need more input.
Regards,
Garvin
There are a few threads on this forum about missing MySQL fulltext keys, maybe you search them up and see if your keys are correct. But then again, if your search works "sometimes", that can't be the case.
Need more input.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Regular
- Posts: 15
- Joined: Thu Jan 06, 2005 1:34 am
- Location: Hong Kong
- Contact:
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
At least on mysql the search is case insensitive. I don't know about the other database types...
Regards,
Garvin
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: Does search works in the recent cvs?
I do input words longer than 3 characters otherwise it willgarvinhicking wrote:When does the search work and when not? You need to use words longer than 3 characters and pay attention to special characters.
There are a few threads on this forum about missing MySQL fulltext keys, maybe you search them up and see if your keys are correct. But then again, if your search works "sometimes", that can't be the case.
Need more input.
Regards,
Garvin
give me some infomation that let me do like this.
I failed either in english or chinese words .
And the search still failed even after I installed a fresh
serendipity in default language (english) with all enries created in english.
Yeah,I got a error like this for the first search:
Code: Select all
The search function did not work as expected. Notice for the administrator of this blog: This may happen because of missing index keys in your database. On MySQL systems your database user account needs to be privileged to execute this query:
CREATE FULLTEXT INDEX entry_idx on serendipity_entries (title,body,extended)
The specific error returned by the database was:
SELECT
e.id,
e.author,
a.username,
a.email,
ec.categoryid,
e.timestamp,
e.comments,
e.title,
e.body,
e.extended,
e.trackbacks,
e.exflag
FROM
serendipity_entries e
LEFT JOIN serendipity_authors a
ON e.authorid = a.authorid
LEFT JOIN serendipity_entrycat ec
ON e.id = ec.entryid
WHERE
MATCH(title,body,extended) AGAINST('Test')
AND isdraft = 'false' AND timestamp <= 1105601476
GROUP BY e.id
ORDER BY timestamp DESC
LIMIT 15
/ Can't find FULLTEXT index matching the column list
mistakes from the real operation,little knowing of mysql):
Code: Select all
mysql>grant CREATE FULLTEXT INDEX entry_idx on serendipity_entries to seuser@localhost
as before.
What should I do ?
And I remembered that I use "grant all privileges on serendipity.* to .." to create serendipity database.
Why is there privileges with index still?
Thank you for your help!
Then I will search these topics with missing fulltex keys again.
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Does search works in the recent cvs?
Hi skyroam!
You are near to the solution. But the serendipity error messages said nothing that you should use a "GRANT" statement. Just use what you entered without 'grant' and it should work.
Regards,
Garvin
You are near to the solution. But the serendipity error messages said nothing that you should use a "GRANT" statement. Just use what you entered without 'grant' and it should work.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Thank you very much, garvinhicking.
I read more articles about it then before,and I knew
that I have partly break the rule "search before ask".
Then I spend some time to test .But I failed again.
Hope what I will type below do not break the rule.
I have just install the latest cvs(s9y_200501141338.tar.gz)
then I do like before(I have do a wrong copy with mysql command that i have done before,sorry for bother you!).
mysql give"error 0,warning 0"
I am using mysql in gentoo linux,
here is the information about version and compiling:
Then I got "No entry found" result.
But after a few minutes(I only switched language between english and chinese during this time) ,I can search english text!
Unfortunately,the same problems appeared.Some of Chinese
chars and english chars can't be searched!
for english example:
I can search this entry by key with "searched" or "content",
such as:
"be searched"
"is the content"
.
I guess that space means "or" to search.
On the other examples,not the last word can be searched:
This entry can be searched by "test"!
Only word more than three chars can be indexed to be searched?
No, I can't search the first example entry("This is a example to be searched!") with key "example"!
I am puzzled.
And I can find nothing regular when I searche chinese.
What should I do to let all of the entried can be searched
by any string longer than 3 chars and no time relay?
I read more articles about it then before,and I knew
that I have partly break the rule "search before ask".
Then I spend some time to test .But I failed again.
Hope what I will type below do not break the rule.
I have just install the latest cvs(s9y_200501141338.tar.gz)
then I do like before(I have do a wrong copy with mysql command that i have done before,sorry for bother you!).
Code: Select all
mysql -useuser -p se
mysql>CREATE FULLTEXT INDEX entry_idx on serendipity_entries (title,body,extended);
I am using mysql in gentoo linux,
here is the information about version and compiling:
Code: Select all
emerge -pv mysql
dev-db/mysql-4.0.23 +berkdb -debug -innodb +perl +readline (-selinux) +ssl -static -tcpd 0 kB
But after a few minutes(I only switched language between english and chinese during this time) ,I can search english text!
Unfortunately,the same problems appeared.Some of Chinese
chars and english chars can't be searched!
for english example:
Code: Select all
example
This is a example to be searched!
Here is the content.:D
such as:
"be searched"
"is the content"
.
I guess that space means "or" to search.
On the other examples,not the last word can be searched:
Code: Select all
My new test for it.hehe
Only word more than three chars can be indexed to be searched?
No, I can't search the first example entry("This is a example to be searched!") with key "example"!
I am puzzled.
And I can find nothing regular when I searche chinese.
What should I do to let all of the entried can be searched
by any string longer than 3 chars and no time relay?
-
- Regular
- Posts: 15
- Joined: Thu Jan 06, 2005 1:34 am
- Location: Hong Kong
- Contact:
Found the code:
In functions_entries.inc.php
To make this case sensitive replace ~ with ~*, so it would be:
In functions_entries.inc.php
Code: Select all
if (strtolower($serendipity['dbType']) == 'postgres') {
$group = '';
$distinct = 'DISTINCT';
$find_part = "(title~'$term' OR body~'$term' OR extended~'$term')";
}
Code: Select all
if (strtolower($serendipity['dbType']) == 'postgres') {
$group = '';
$distinct = 'DISTINCT';
$find_part = "(title~*'$term' OR body~*'$term' OR extended~*'$term')";
}