Return-Path: X-Original-To: apmail-lucene-solr-user-archive@minotaur.apache.org Delivered-To: apmail-lucene-solr-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F226D10B07 for ; Wed, 26 Mar 2014 08:34:55 +0000 (UTC) Received: (qmail 77083 invoked by uid 500); 26 Mar 2014 08:34:50 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 77030 invoked by uid 500); 26 Mar 2014 08:34:49 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 77022 invoked by uid 99); 26 Mar 2014 08:34:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Mar 2014 08:34:49 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of diablo47@gmail.com designates 209.85.213.171 as permitted sender) Received: from [209.85.213.171] (HELO mail-ig0-f171.google.com) (209.85.213.171) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Mar 2014 08:34:44 +0000 Received: by mail-ig0-f171.google.com with SMTP id hl1so267883igb.10 for ; Wed, 26 Mar 2014 01:34:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=yqZw1d/RUj7O5+3+atSmDW1zPRNmNVsjANFKmkG2Mn0=; b=ooVXzJbYdDiu7ymhaX9MVgxlCpBetF6wH/dHrC+fIC/Hw9zFcZPF0JcF0DKBklld8P z/VE01CxispkKQ4FCOTgaoVD+JAztzs9WBIpYNw5bSKmUCYLYvM+AaRQrpXeHKi247K/ yt4EhWvPWQc6sCylq+Z2mbm8bU0Swr/O2ngOARfbCW2PmK8Wn1eD8b3vvLp8R6IDGGR0 3w28MIxE6g2WPOSbig6aEkDxkxqQ8aL7t02X5t0aoGh+wW/mSMTE/fh+7JzgYGomBICi 2inPc64YyuWJYpZSr3GdY7Bsc5171icSW7dDacqDsuMo7INVEiCZ8rquEtqwrPPMlcYC mYSg== MIME-Version: 1.0 X-Received: by 10.50.57.17 with SMTP id e17mr22928805igq.13.1395822862674; Wed, 26 Mar 2014 01:34:22 -0700 (PDT) Received: by 10.43.167.200 with HTTP; Wed, 26 Mar 2014 01:34:22 -0700 (PDT) In-Reply-To: References: Date: Wed, 26 Mar 2014 16:34:22 +0800 Message-ID: Subject: Re: Multiple Languages in Same Core From: Liu Bo To: solr-user@lucene.apache.org Content-Type: multipart/alternative; boundary=e89a8f2354fde631bf04f57e55a9 X-Virus-Checked: Checked by ClamAV on apache.org --e89a8f2354fde631bf04f57e55a9 Content-Type: text/plain; charset=ISO-8859-1 Hi Jeremy There're a lot of multi language discussions, two main approaches 1. like yours, a language is one core 2. all in one core, different language has it's own field. We have multi-language support in a single core, each multilingual field has it's own suffix such as name_en_US. We customized query handler to hide the query details to client. The main reason we want to do this is about NRT index and search, take product for example: product has price, quantity which is common and it's used by filtering and sorting, name, description is multi language field, if we split product in do different cores, the common field updating may end up a update in all of the multi language cores. As to scalability, we don't change solr cores/collections when a new language is added, but we probably need update our customized index process and run a full re-index. This approach suits our requirement for now, but you may have your own concerns. We have similar "suggest filter" problem like yours, we want to return suggest result filtering by stores. I can't find a way to build dictionary with query at my version of solr 4.6 What I do is run a query on a N-Gram analyzed field and with filter queries on store_id field. The "suggest" is actually a query. It may not perform as well as suggestion but can do the trick. You can try it to build a additional N-GRAM field for suggestion only and search on it with fq on your "Locale" field. All the best Liu Bo On 25 March 2014 09:15, Alexandre Rafalovitch wrote: > Solr In Action has a significant discussion on the multi-lingual > approach. They also have some code samples out there. Might be worth a > look > > Regards, > Alex. > Personal website: http://www.outerthoughts.com/ > LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch > - Time is the quality of nature that keeps events from happening all > at once. Lately, it doesn't seem to be working. (Anonymous - via GTD > book) > > > On Tue, Mar 25, 2014 at 4:43 AM, Jeremy Thomerson > wrote: > > I recently deployed Solr to back the site search feature of a site I work > > on. The site itself is available in hundreds of languages. With the > initial > > release of site search we have enabled the feature for ten of those > > languages. This is distributed across eight cores, with two Chinese > > languages plus Korean combined into one CJK core and each of the other > > seven languages in their own individual cores. The reason for splitting > > these into separate cores was so that we could have the same field names > > across all cores but have different configuration for analyzers, etc, per > > core. > > > > Now I have some questions on this approach. > > > > 1) Scalability: Considering I need to scale this to many dozens more > > languages, perhaps hundreds more, is there a better way so that I don't > end > > up needing dozens or hundreds of cores? My initial plan was that many > > languages that didn't have special support within Solr would simply get > > lumped into a single "default" core that has some default analyzers that > > are applicable to the majority of languages. > > > > 1b) Related to this: is there a practical limit to the number of cores > that > > can be run on one instance of Lucene? > > > > 2) Auto Suggest: In phase two I intend to add auto-suggestions as a user > > types a query. In reviewing how this is implemented and how the > suggestion > > dictionary is built I have concerns. If I have more than one language in > a > > single core (and I keep the same field name for suggestions on all > > languages within a core) then it seems that I could get suggestions from > > another language returned with a suggest query. Is there a way to build a > > separate dictionary for each language, but keep these languages within > the > > same core? > > > > If it's helpful to know: I have a field in every core for "Locale". > Values > > will be the locale of the language of that document, i.e. "en", "es", > > "zh_hans", etc. I'd like to be able to: 1) when building a suggestion > > dictionary, divide it into multiple dictionaries, grouping them by > locale, > > and 2) supply a parameter to the suggest query that allows the suggest > > component to only return suggestions from the appropriate dictionary for > > that locale. > > > > If the answer to #1 is "keep splitting groups of languages that have > > different analyzers into their own cores" and the answer to #2 is "that's > > not supported", then I'd be curious: where would I start to write my own > > extension that supported #2? I looked last night at the suggest lookup > > classes, dictionary classes, etc. But I didn't see a clear point where it > > would be clean to implement something like I'm suggesting above. > > > > Best Regards, > > Jeremy Thomerson > -- All the best Liu Bo --e89a8f2354fde631bf04f57e55a9--