Re: Error when indexing XML files

2009-10-16 Thread Fergus McMenemie
Hi,

Please find the schema file attached. Please let me know what I am doing wrong.

Regards
Chaitali

--- On Wed, 10/14/09, Fergus McMenemie fer...@twig.me.uk wrote:


From: Fergus McMenemie fer...@twig.me.uk
Subject: Re: Error when indexing XML files
To: solr-user@lucene.apache.org
Date: Wednesday, October 14, 2009, 2:25 AM

Hi,

I am trying to index XML files using SolrJ. The original XML file contains 
nested elements. For example, the following is the snippet of the XML file.

entry
 nameSOMETHING /name
 facilitySOME_OTHER_THING/facility
 /entry

I have added the elements name and facility in Schema.xml file to make 
these elements indexable. I have changed the XML document above to look like -

add
doc
 ..
 field name=nameSOMETHING/field
 ..
/doc
/add

Can you send us the Schema.xml file you created? I suspect that
one of the fields should be multivalued.



   field name=facility type=string indexed=true stored=true/
   field name=name type=text indexed=true stored=true/

one or other, perhaps both your fields need to be

   field name=facility type=string indexed=true stored=true 
multiValued=true/
   field name=name type=text indexed=true stored=true 
multiValued=true/



-- 
Fergus.


Re: Error when indexing XML files

2009-10-16 Thread Fergus McMenemie
Hi,

Please find the schema file attached. Please let me know what I am doing wrong.

Regards
Chaitali

--- On Wed, 10/14/09, Fergus McMenemie fer...@twig.me.uk wrote:


From: Fergus McMenemie fer...@twig.me.uk
Subject: Re: Error when indexing XML files
To: solr-user@lucene.apache.org
Date: Wednesday, October 14, 2009, 2:25 AM

Hi,

I am trying to index XML files using SolrJ. The original XML file contains 
nested 
 elements. For example, the following is the snippet of the XML file.

entry
 nameSOMETHING /name
 facilitySOME_OTHER_THING/facility
 /entry

I have added the elements name and facility in Schema.xml file to make 
these 
elements indexable. I have changed the XML document above to look like -

add
doc
 ..
 field name=nameSOMETHING/field
 ..
/doc
/add

Can you send us the Schema.xml file you created? I suspect that
one of the fields should be multivalued.



   field name=facility type=string indexed=true stored=true/
   field name=name type=text indexed=true stored=true/

one or other, perhaps both your fields need to be

   field name=facility type=string indexed=true stored=true 
multiValued=true/
   field name=name type=text indexed=true stored=true 
multiValued=true/


-- 
Fergus


Re: Error when indexing XML files

2009-10-14 Thread Fergus McMenemie
Hi, 

I am trying to index XML files using SolrJ. The original XML file contains 
nested elements. For example, the following is the snippet of the XML file. 

entry
  nameSOMETHING /name
  facilitySOME_OTHER_THING/facility
 /entry

I have added the elements name and facility in Schema.xml file to make 
these elements indexable. I have changed the XML document above to look like - 

add
doc
 ..
 field name=nameSOMETHING/field 
 ..
/doc
/add

Can you send us the Schema.xml file you created? I suspect that 
one of the fields should be multivalued.

-- 
Fergus.


Re: Error when indexing XML files

2009-10-14 Thread Chaitali Gupta
Hi, 

Please find the schema file attached. Please let me know what I am doing wrong. 

Regards
Chaitali 

--- On Wed, 10/14/09, Fergus McMenemie fer...@twig.me.uk wrote:

From: Fergus McMenemie fer...@twig.me.uk
Subject: Re: Error when indexing XML files
To: solr-user@lucene.apache.org
Date: Wednesday, October 14, 2009, 2:25 AM

Hi, 

I am trying to index XML files using SolrJ. The original XML file contains 
nested elements. For example, the following is the snippet of the XML file. 

entry
  nameSOMETHING /name
  facilitySOME_OTHER_THING/facility
 /entry

I have added the elements name and facility in Schema.xml file to make 
these elements indexable. I have changed the XML document above to look like - 

add
doc
 ..
 field name=nameSOMETHING/field 
 ..
/doc
/add

Can you send us the Schema.xml file you created? I suspect that 
one of the fields should be multivalued.

-- 
Fergus.



  ?xml version=1.0 encoding=UTF-8 ?
!--
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to You under the Apache License, Version 2.0
 (the License); you may not use this file except in compliance with
 the License.  You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an AS IS BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
--

!--  
 This is the Solr schema file. This file should be named schema.xml and
 should be in the conf directory under the solr home
 (i.e. ./solr/conf/schema.xml by default) 
 or located where the classloader for the Solr webapp can find it.

 This example schema is the recommended starting point for users.
 It should be kept correct and concise, usable out-of-the-box.

 For more information, on how to customize this file, please see
 http://wiki.apache.org/solr/SchemaXml
--

schema name=example version=1.1
  !-- attribute name is the name of this schema and is only used for display purposes.
   Applications should change this to reflect the nature of the search collection.
   version=1.1 is Solr's version number for the schema syntax and semantics.  It should
   not normally be changed by applications.
   1.0: multiValued attribute did not exist, all fields are multiValued by nature
   1.1: multiValued attribute introduced, false by default --

  types
!-- field type definitions. The name attribute is
   just a label to be used by field definitions.  The class
   attribute and any other attributes determine the real
   behavior of the fieldType.
 Class names starting with solr refer to java classes in the
   org.apache.solr.analysis package.
--

!-- The StrField type is not analyzed, but indexed/stored verbatim.  
   - StrField and TextField support an optional compressThreshold which
   limits compression (if enabled in the derived fields) to values which
   exceed a certain size (in characters).
--
fieldType name=string class=solr.StrField sortMissingLast=true omitNorms=true/

!-- boolean type: true or false --
fieldType name=boolean class=solr.BoolField sortMissingLast=true omitNorms=true/

!-- The optional sortMissingLast and sortMissingFirst attributes are
 currently supported on types that are sorted internally as strings.
   - If sortMissingLast=true, then a sort on this field will cause documents
 without the field to come after documents with the field,
 regardless of the requested sort order (asc or desc).
   - If sortMissingFirst=true, then a sort on this field will cause documents
 without the field to come before documents with the field,
 regardless of the requested sort order.
   - If sortMissingLast=false and sortMissingFirst=false (the default),
 then default lucene sorting will be used which places docs without the
 field first in an ascending sort and last in a descending sort.
--


!-- numeric field types that store and index the text
 value verbatim (and hence don't support range queries, since the
 lexicographic ordering isn't equal to the numeric ordering) --
fieldType name=integer class=solr.IntField omitNorms=true/
fieldType name=long class=solr.LongField omitNorms=true/
fieldType name=float class=solr.FloatField omitNorms=true/
fieldType name=double class=solr.DoubleField omitNorms=true/


!-- Numeric field types that manipulate the value into
 a string value that isn't human-readable in its internal form,
 but with a lexicographic ordering the same as the numeric

Error when indexing XML files

2009-10-13 Thread Chaitali Gupta
Hi, 

I am trying to index XML files using SolrJ. The original XML file contains 
nested elements. For example, the following is the snippet of the XML file. 

entry
  nameSOMETHING /name
  facilitySOME_OTHER_THING/facility
 /entry

I have added the elements name and facility in Schema.xml file to make 
these elements indexable. I have changed the XML document above to look like - 

add
doc
 ..
 field name=nameSOMETHING/field 
 ..
/doc
/add

 I am getting the following error when I start Jetty - 

org.apache.solr.common.SolrException: 
ERROR_5457843_multiple_values_encountered_for_non_multiValued_field_facility___tracklesstrackless_

Can anyone please let me know if there is something I am doing wrong ? 

How can I maintain the parent-child relationship of the original XML file in 
the modified XML file?  Can I not use the original XML file as it is for 
indexing purposes? 

Thanks in advance. 

- Chaitali