Hi Maciej! Thanks again for your help! I just updated Roller to Lucene
4.4.0 to make sure you have the latest and greatest tools available.
On 07/29/2013 09:43 AM, Maciej Rumianowski wrote:
Hi *,
I have analyzed how searching works with "I publish my weblog in
multiple languages" set to true.
Main problem is that search results have links to Entry page with no
locale or the same locale as on Search Page
(http://localhost:8083/roller/test/en/search?q=post). This makes links
broken if they are in different locale.
I reproduced that on trunk. However (thankfully) entry URLs are all
unique regardless of the language they're in. For example, if you
create two blog entries with both the same title "test blog entry" but
one is in French and the other in German, the URLs generated will be
entry/test_blog_article and entry/test_blog_article1 (as well as the
alternatives fr/entry/test_blog_article and de/entry/test_blog_article1;
swapping the de and fr in the preceding URLs will return 404s as you've
noted.)
One simple solution, if we don't care to provide a search-by-language
option, is to just strip out the locale from the search results URLs,
get rid of the /fr/ and /de/, that will fix the broken links.
As a fix I did this:
1. Enabled searching by language (Field in Index) - Index needs to be
rebuild
2. Added "public String entry(WeblogEntryWrapper entry)" to URLModel
to enable returning links to entries with their locale; and changed
accordingly basic theme _day.vm template
But the template changes only if someone's specified that they publish
in multiple languages (as I hope?), i.e. no language drop down for
monolingual blogs? Just as the new blog entry page has a choose language
drop-down only if you make that specification. Also, I suspect the main
blog front page should *not* have a language dropdown option (maybe it
can be a template that a user can customize his blog with, but it won't
be the default), as few will use it and adds unwanted clutter; however,
the search results page for a multilinguage page can have that language
drop-down, defaulted to "any language" -- how does that sound?
[There's one more bug, if you had the time to look at it that would be
great. When I'm on the search results page and search on "dog", I'll
get the articles with "dog" in it but with no word highlighting in the
text. Staying on the search results page, if I query "cat", I'll get
the cat articles, but the word "dog" will be highlighted whereever it
appears in the cat articles. If I next search on "horse", I get the
horse articles with the word "cat" highlighted, etc., etc.]
Regards,
Glen
I am waiting for your feedback. :)
If You like this solution I can change other themes and document the
change in URLModel.
Best Regards,
Maciej Rumianowski