← Back to team overview

ubuntu-appstore-developers team mailing list archive

Re: Translations of metadata

 

Awesome :-)


On Wed, Jun 26, 2013 at 1:03 PM, James Tait <james.tait@xxxxxxxxxxxxx>wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 26/06/13 15:24, Roberto Alsina wrote:
> >
> > The Solr query syntax is quite rich, so we can search against
> > multiple fields if we want.
> >
> > But I don't think the client guys should need to worry about that -
> > we have a multiValued field called "text" plonked at the end of
> > the schema that doesn't currently do anything.  The intention is
> > to copyField all the searchable fields into that.  It looks like
> > we'll need to add localised versions of it as well, but the
> > principle remains the same.
> >
> >
> > Wouldn't this make a search for "foo" match all translations?
> > That's not a very good idea.
>
> No - we'll have localised versions of the text field as well, and
> appropriate copyField directives for each language, along the lines of:
>
> <fieldType "text_en" class="solr.TextField" ...>
>   <analyzer>
>     ...
>     <filter class="solr.EnglishMinimalStemFilterFactory/>
>   </analyzer>
> </fieldType>
>
> <fieldType "text_es" class="solr.TextField" ...>
>   <analyzer>
>     ...
>     <filter class="solr.SpanishLightStemFilterFactory"/>
>   </analyzer>
> </fieldType>
>
> <field name="title_en" type="text_en" .../>
> <field name="title_es" type="text_es" .../>
> <field name="description_en" type="text_en" .../>
> <field name="description_es" type="text_es" .../>
> <field name="text_en" type="text_en" multiValued="true" .../>
> <field name="text_es" type="text_es" multiValued="true" .../>
>
> <copyField source="title_en" dest="text_en"/>
> <copyField source="description_en" dest="text_en"/>
> <copyField source="title_es" dest="text_es"/>
> <copyField source="description_es" dest="text_es"/>
>
> A request to /api/v1/search?q=foo with a header "Accept-Language: es"
> would cause the Index to query Solr with "?q=text_es:foo".
>
> Thoughts?
>
> JT
> - --
> James Tait, BSc. | https://launchpad.net/~jamestait/
> Software Engineer, Canonical Online Services, Web and Ops Team
> Ubuntu - Linux for human beings | www.ubuntu.com
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
> Comment: Using GnuPG with undefined - http://www.enigmail.net/
>
> iEYEARECAAYFAlHLEOoACgkQyDo4xMNTLiaXjwCfbGOrNCNoTBe70karNx6hdDGP
> TJsAmQG0w3xeFY9KeTKLhP4+dh4fBh/0
> =gCRf
> -----END PGP SIGNATURE-----
>

References