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 D1FDC17B2A for ; Sun, 28 Sep 2014 21:23:15 +0000 (UTC) Received: (qmail 34375 invoked by uid 500); 28 Sep 2014 21:23:12 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 34301 invoked by uid 500); 28 Sep 2014 21:23:12 -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 34288 invoked by uid 99); 28 Sep 2014 21:23:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 28 Sep 2014 21:23:11 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of arafalov@gmail.com designates 209.85.212.173 as permitted sender) Received: from [209.85.212.173] (HELO mail-wi0-f173.google.com) (209.85.212.173) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 28 Sep 2014 21:23:07 +0000 Received: by mail-wi0-f173.google.com with SMTP id bs8so763610wib.0 for ; Sun, 28 Sep 2014 14:22:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=z4WFRSFgrG8rRtwM7ZRdfeNZnyyhSLOshfI0B817DAk=; b=FaVQs2yKbJyCYM5rQXrEw35bd5fK703xs3ooosVeqDoyThqYf5TAjIf13kVQVSVAer 1hPxB+VbUubhyodCWdlE8VnLxJaE+9Uv0cha1YCIfj5XnZijv0AXSGrdLDvrK+6Ce/1e /Ixin7pIEXZN7CX6gtOLatYtBTcTGJmzki+hb/sklbJi+V0Daj7dGfp4p7ctvWtyoJpM eVRZ9RoKDtmJJZmGjObbbbr2yKvstWqRY7PrZVps0y1KGy04bHmBlgk9IwkXJatP4xDt rggd7OGsBI6E4xw3frbFwqxtqu0ZSFMN48I+I6+zjLCISQc3ckxYAhny6owXG7bANDVy sMGw== X-Received: by 10.180.36.141 with SMTP id q13mr42335070wij.32.1411939366586; Sun, 28 Sep 2014 14:22:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.27.79.144 with HTTP; Sun, 28 Sep 2014 14:22:06 -0700 (PDT) In-Reply-To: References: From: Alexandre Rafalovitch Date: Sun, 28 Sep 2014 17:22:06 -0400 Message-ID: Subject: Re: applicability of schema on document To: solr-user Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org Anurag, Just answering your three emails on two emailing lists. You seem to want to jump into the middle of Solr and then dig your way both ways. So, your question here is a mix of very basic and unnecessarily complicated. Specifically, you seem to be missing a link between schema.xml and solrconfig.xml. You need to look at both of the files if you are actually trying to understand what's going on, as opposed to just changing one thing to get from one point to another. Both files for multiple examples that come with Solr are heavily documented and give you MORE than you want to know. In fact, half of the solrconfig.xml is a bit scary to me right now and I wrote a book on Solr. But it has the answers and if you just read it, you will know better questions to ask. Regards, Alex. P.s. Feel free to ignore this, we'll help you anyway. It's just that the above might be MORE efficient than the strategy you selected so far. Personal: http://www.outerthoughts.com/ and @arafalov Solr resources and newsletter: http://www.solr-start.com/ and @solrstart Solr popularizers community: https://www.linkedin.com/groups?gid=6713853 On 27 September 2014 04:05, Anurag Sharma wrote: > I am trying to understand how the schema and it's field types gets applied > to a document. Is it based on a document Id e.g. how to specify solr to > store fields like age as integer, dateofbirth as date but not as a string > or vice versa. Also, is it possible to change the field type at runtime? > > Direct update using below command adds the values even when the id doesn't > exist: > curl http://localhost:8983/solr/update\?commit\=true -H > 'Content-type:application/json' -d '[{"dob": {"add": > ["2014-02-12T12:00:00Z", "2014-07-16T12:00:00Z"]}, "id": 1111}]' > My doubts in the above scenario are: > > - Is it taking some default types based on parsed values? > - Is it also possible to store multiple types in a single field? > - What are the rules for schema less doc > > Above scenario is tried using solr.war in example/webapps Following are > multiple schema files in example directory > ./example/example-DIH/solr/db/conf/schema.xml > ./example/example-DIH/solr/mail/conf/schema.xml > ./example/example-DIH/solr/rss/conf/schema.xml > ./example/example-DIH/solr/solr/conf/schema.xml > ./example/example-DIH/solr/tika/conf/schema.xml > ./example/example-schemaless/solr/collection1/conf/schema.xml > ./example/multicore/core0/conf/schema.xml > ./example/multicore/core1/conf/schema.xml > ./example/solr/collection1/conf/schema.xml > > > Any documentation or unit tests describing the flow, creating and using the > schema will be helpful. > > Thanks > Anurag