I'm still working with my PW powered site. I really love PW, but I've got problem with searching engine, while this is the most important part of my site (norwegian to polish dictionary)
My searching rules:
if (strlen($q)<=4) {
// My sollution for short words:
$matches = $pages->find("title|translation=$q, sort=title, limit=100");
// $matches = $pages->find("title|translation|definition%=$q, sort=title, sort=translation, limit=100");
// $matches = $pages->find("title|translation|definition^=$q, sort=title, sort=translation, limit=100");
}
else
{
$matches = $pages->find("title|translation|definition~=$q, sort=title, sort=translation, limit=50");
}
Some examples:
Search word: sąd
Results:
domstol
sąd
frukthage en
sad
Search word: bąk
Results:
bak
za, z tyłu, w tyle
bak en
pośladek, tył
rørdrum en
bąk
So it looks that ą = a :/ Can someone tell me why?
Another problem:
When I'll change search querry to:
$matches = $pages->find("title|translation|definition%=$q, sort=title, sort=translation, limit=100");
and I'm searching for: dom ("house" in english and "hus" in norwegian)I've got these results:
advisere
ogłosić, powiadomić
aktivitetshus et
dom kultury
alderdom en
starość
aldershjem et
dom starców
ane
przeczuwać, domyślać się, podejrzewać
ane - aner - ante - ant
etc... while I don't get hus in the first 100 matches :/
When I'll change search querry to:
$matches = $pages->find("title|translation|definition%=$q, limit=100");
It's a little bit better, but still hus is very far from beginning of the search results.
How can I improve that? Is there any rule to sort results by match?














