From: Peter S. <st...@we...> - 2012-04-20 11:23:06
|
Just a quick comment: When you want to use lucene for full text search then you probably want to set up different analyzers for your languages. So option 2 is the only one which supports that scenario since indexes are defined on a collection basis. Hope that helps Peter Am 20.04.2012 um 10:53 schrieb Stéphane S.: > Hi, > > I would like to manage multilingual resources in a web application done with eXist and I am seeking for an advice on how to organize the database resources and collections, please apologize me if this list is the wrong place for such discussions. > > Basically, if there is a resource "mydoc.xml" inside a collection /db/data containing a <Doc>...</Doc> to be stored in two languages, I see two options : > > Option 1 : create a single resource with two "forks" under a common root (e.g. AnyLanguage) > > <AnyLanguage> > <Doc xml:lang="en">...</Doc> > <Doc xml:lang="fr">...</Doc> > </AnyLanguage> > > Option 2: create two collections (en and fr) and store two documents (this also applies to full hierarchies of multilingual resources) > > collection /db/data/en contains mydoc.xml that contains <Doc xml:lang="en">...</Doc> > collection /db/data/fr contains mydoc.xml that contains <Doc xml:lang="fr">...</Doc> > > Simply considering querying data, I guess with option 1 one would have to write : > > let $lang := 'en' > return collection('/db/data')/AnyLanguage/Doc[@xml:lang = $lang]//{my-path-expression} > > whereas using option 2 that would be something like: > > let $lang := 'en' > return collection(concat('/db/data/', $lang)//{my-path-expression} > > I am wondering if there are some hidden drawbacks in using one option or the other (performance, sustainability, etc.) ? > > Can anybody with experience in this regards could give me an advice ? How do you manage this in your applications ? > > Thanks in advance, > > Stéphane S. > --- > > > > > > ------------------------------------------------------------------------------ > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundary-d2dvs2 > _______________________________________________ > Exist-open mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-open -- Peter Stadler Carl-Maria-von-Weber-Gesamtausgabe Arbeitsstelle Detmold Gartenstr. 20 D-32756 Detmold Tel. +49 5231 975-665 Fax: +49 5231 975-668 stadler at weber-gesamtausgabe.de www.weber-gesamtausgabe.de |