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 E0644D5BC for ; Sat, 8 Sep 2012 20:27:47 +0000 (UTC) Received: (qmail 43479 invoked by uid 500); 8 Sep 2012 20:27:44 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 43433 invoked by uid 500); 8 Sep 2012 20:27:44 -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 43425 invoked by uid 99); 8 Sep 2012 20:27:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Sep 2012 20:27:44 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FSL_RCVD_USER,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of erickerickson@gmail.com designates 209.85.214.176 as permitted sender) Received: from [209.85.214.176] (HELO mail-ob0-f176.google.com) (209.85.214.176) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Sep 2012 20:27:37 +0000 Received: by obbtb18 with SMTP id tb18so1374373obb.35 for ; Sat, 08 Sep 2012 13:27:16 -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:content-transfer-encoding; bh=fIsA/2MiiFN3YZhmbsX0ee3iTYCdVj+ZcMkb1GhIa1I=; b=VpquZQJ7F7WtyeIrvZx7eQwh8j50VtSGWYTdLLehfOdwYMegLfOsdnGd7agpNd3MyS IYhF4tH0uYMCKoDLMwLrzU4d66Vl8QkidZgvV2aNkghVUbosjjQYetPTTBVXJVwZ9MYX NTsj4Kw8KV64ehPqjE7F9OdBVR7GxMyX660YwyCqpzWpaj4ddMrbBiA3oExx97FNU6YQ 5E0+xIzO8DZ64IZDPz/MuWit7XLNkVT0mJBgkI0tQka0ddvFnlq1o25Vu2bWdVhnr/ql nVZvc5OzQ0cxj2ZoOgvXJtODuqdUNlCSjSb+7PkBY2pHjE2V7TXx1TXOQNUgwbrfXLTp dwAg== MIME-Version: 1.0 Received: by 10.182.44.74 with SMTP id c10mr9545449obm.29.1347136036148; Sat, 08 Sep 2012 13:27:16 -0700 (PDT) Received: by 10.60.84.39 with HTTP; Sat, 8 Sep 2012 13:27:16 -0700 (PDT) In-Reply-To: References: Date: Sat, 8 Sep 2012 13:27:16 -0700 Message-ID: Subject: Re: Re: Schema model to store additional field metadata From: Erick Erickson To: solr-user@lucene.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable You might be confusing indexing and storing. When you specify index=3D"true" in your field definition, the input is tokenized, transformed, etc and the results of this (see the admin/analysis) page is what is searched. But when you specify stored=3D"true", a literal, verbatim copy of the text is put in a distinct file, and when you return data (e.g. fl=3Dfield1, field2...) then the verbatim copy is returned. If you specify both index=3D"true" and stored=3D"true" both things happen, but they're entirely separate operations even though they're on the same field.... So, let's assume you want to provide links to the images. Having a field (multiValued?) with index=3D"false" and stored=3D"true" would allow you to store all the img urls in a single field. All that said, now it's up to your application layer that constructs the pages for presentation to the user to "do the right thing" with the returned fields to allow images (or whatever) to be displayed. Best Erick On Fri, Sep 7, 2012 at 12:03 PM, wrote: >> Why would you store the actual images in SOLR? > > No, the images are files on the filesystem. Only the path to the image sh= ould be stored in Solr. > >> And you are most likely looking at dynamic fields as the solution >> >> 1) Define *_Path, *_Size, *_Alt as a dynamic field with appropriate type= s >> 2) During indexing, write those properties as Image_1_Path, >> Image_1_Size, Image_1_Alt or some such >> 3) Make sure that whatever search algorithm you have looks at those or >> do a copyField to aggregate them into AllImage_Alt, etc. > > I was also thinking of a solution with dynamic fields, but I am very new = to Solr and I am not sure if it is a good solution to solve this modelling = issue. For example I thought about introducing two multiValued dynamic fiel= ds (image_src_*, image_alt_*) and store image data like file path on disc a= nd alt-attribute like this: > > title: An article about Foo and Bar > content: This is some text about Foo and Bar. > published: 2012.09.07T19:23 > image_src_1: 2012/09/foo.png > image_alt_1: Foo. Waiting for the bus. > image_src_2: 2012/04/images/bar.png > image_src_3: 2012/02/abc.png > image_alt_3: Foo and Bar at the beach > > Of course a alt attribute for some images could be missing. I don't know = if this is a good or better solution for this. It feels clumsy to me, like = a workaround. But maybe this is the way to model this data, I don't know?