Hi Glen.

2013/7/29 Glen Mazza <glen.ma...@gmail.com>

> 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.

Great, I saw that ;)

>
>
> 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<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.

Could be, but there some info lost:
1. Locale when going to entry (default locale will be applied for messages)
2. Mix of url (with and without locales) in Google Analytics as in comment
https://issues.apache.org/jira/browse/ROL-1964?focusedCommentId=13719466&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13719466

However, stripping locale will preserve backward compatibility, because
before fix "ROL-1964: Have SearchServlet retain locale."
*1507039*<http://svn.apache.org/viewvc?view=revision&revision=1507039>
On Search Page there where always non locale urls.

>
>
>
>> 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?


Yes. I change the behaviour only when "I publish my weblog in multiple
languages" is set to true. So monolingual blog should not have any changes
in url, searches etc.

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?
>
Search form on main page have a hidden input with locale of the page or if
there is no locale then input is not added to form.
Language chooser is in the SearchAgain form which is shown mainly on Search
Page and is shown only if blog isEnableMultiLang.
The idea with additional theme sounds interesting and I will check it.

>
> [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.]
>
Okay I can take a look at this one. :) As soon as I finished locale
searches, because this one is for my future site.

Best Regards,
    Maciej

Reply via email to