Return-Path: X-Original-To: apmail-lucene-solr-commits-archive@minotaur.apache.org Delivered-To: apmail-lucene-solr-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 33B76633F for ; Fri, 29 Jul 2011 17:37:45 +0000 (UTC) Received: (qmail 53182 invoked by uid 500); 29 Jul 2011 17:37:45 -0000 Delivered-To: apmail-lucene-solr-commits-archive@lucene.apache.org Received: (qmail 53147 invoked by uid 500); 29 Jul 2011 17:37:44 -0000 Mailing-List: contact solr-commits-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-commits@lucene.apache.org Received: (qmail 53140 invoked by uid 99); 29 Jul 2011 17:37:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jul 2011 17:37:44 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.131] (HELO eos.apache.org) (140.211.11.131) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jul 2011 17:37:41 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id D83A198F; Fri, 29 Jul 2011 17:37:20 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Apache Wiki To: Apache Wiki Date: Fri, 29 Jul 2011 17:37:20 -0000 Message-ID: <20110729173720.73534.20477@eos.apache.org> Subject: =?utf-8?q?=5BSolr_Wiki=5D_Update_of_=22Solrj=22_by_Tom_Gullo?= Auto-Submitted: auto-generated X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Solr Wiki" for chan= ge notification. The "Solrj" page has been changed by Tom Gullo: http://wiki.apache.org/solr/Solrj?action=3Ddiff&rev1=3D59&rev2=3D60 } }}} = + =3D=3D Use Groovy and Grape =3D=3D + {{{ + = + @Grab(group=3D'org.apache.solr', module=3D'solr-solrj', version=3D'1.4.1') + @Grab(group=3D'org.slf4j', module=3D'slf4j-jdk14', version=3D'1.5.5') + import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer + import org.apache.solr.common.SolrInputDocument + = + String url =3D "http://localhost:8983/solr" + def server =3D new CommonsHttpSolrServer( url ); + = + def doc =3D new SolrInputDocument() + = + doc.addField("id", 2) + doc.addField("word_s", "Cow") + doc.addField("desc_t", "Farm Animal") + = + server.add(doc) + server.commit() + = + println 'done' + = + = + }}} +=20