Return-Path: Delivered-To: apmail-lucene-solr-dev-archive@minotaur.apache.org Received: (qmail 49229 invoked from network); 3 Dec 2009 15:59:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Dec 2009 15:59:44 -0000 Received: (qmail 56983 invoked by uid 500); 3 Dec 2009 15:59:43 -0000 Delivered-To: apmail-lucene-solr-dev-archive@lucene.apache.org Received: (qmail 56882 invoked by uid 500); 3 Dec 2009 15:59:43 -0000 Mailing-List: contact solr-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-dev@lucene.apache.org Delivered-To: mailing list solr-dev@lucene.apache.org Received: (qmail 56872 invoked by uid 99); 3 Dec 2009 15:59:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Dec 2009 15:59:43 +0000 X-ASF-Spam-Status: No, hits=-10.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Dec 2009 15:59:41 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3AFCF234C4B4 for ; Thu, 3 Dec 2009 07:59:21 -0800 (PST) Message-ID: <196606101.1259855961240.JavaMail.jira@brutus> Date: Thu, 3 Dec 2009 15:59:21 +0000 (UTC) From: "Noble Paul (JIRA)" To: solr-dev@lucene.apache.org Subject: [jira] Commented: (SOLR-1612) Use java.sql.Array to populate Multivalue field in DataImportHandler In-Reply-To: <1537893849.1259599640730.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SOLR-1612?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785371#action_12785371 ] Noble Paul commented on SOLR-1612: ---------------------------------- Users usually add their jars into solr.home/lib and it works . If it doesn't ,it should be a problem > Use java.sql.Array to populate Multivalue field in DataImportHandler > -------------------------------------------------------------------- > > Key: SOLR-1612 > URL: https://issues.apache.org/jira/browse/SOLR-1612 > Project: Solr > Issue Type: Improvement > Components: contrib - DataImportHandler > Affects Versions: 1.4 > Reporter: Matt Inger > Fix For: 1.5 > > Attachments: SOLR-1612.patch > > > I am attaching a patch to the JdbcDataSource class which allows the it to populate a multiValued field from a query which returns a java.sql.Array type for a column value. > In order to make this work, you need to do the following: > 1. In your schema.xml file, set the "multiValued" attribute to the value "true" > > 2. Have your sql query return a sql type of java.sql.Types.ARRAY. How to do this is very database dependent, but in oracle, you first create a type: > create or replace type FOO_TYPE IS TABLE OF VARCHAR2(255); > and then when you select the values, you have to use MULTISET and cast to the created type (assuming here that FOO_PARENT_ID is the condition to > limit which foos belong to the current record): > CAST(MULTISET(SELECT FOO FROM FOOS WHERE FOO_PARENT=FOO_PARENT_ID) AS FOO_TYPE ) MY_FOOS > The main advantage this has is it can save you a ton of queries over the current method which will fire off an individual query for each document in order to retrieve the values for each multiValued field. This method executes much faster, and saves alot of database resources. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.