You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Spadez <ja...@hotmail.com> on 2012/05/09 15:59:23 UTC
Newbie Tries to make a Schema.xml
Hi,
I’m totally out of my depth here but I am trying, so I apologise if this is
a bit of a basic question. I need the following information to be indexed
and then made searchable by Solr:
Title – A title for the company
Company – The name of the company
Description – A description of the company
Location – The text location of a company (e.g London)
Longitudinal – The numerical longitudinal reference for spatial searching
Latitudinal – The numerical latitudinal reference for spatial searching
Date – The date that the record was added
Source – The name of the site where this data was collected from
>From this, I made this very basic schema.xml:
<uniqueKey>id</uniqueKey>
<defaultSearchField>title</defaultSearchField>
<solrQueryParser defaultOperator=“OR”/>
<field name=“id” type=“string” indexed=“true” stored=“true”/>
<field name=“title” type=“text” indexed=“true” stored=“true”/>
<field name=“description” type=“text” indexed=“true” stored=“true”/>
<field name=“company” type=“text” indexed=“true” stored=“true”/>
<field name=“location_name” type=“text” indexed=“true” stored=“true”/>
<field name=“longitudinal” type=“string” indexed=“true” stored=“true”/>
<field name=“latidudinal” type=“string” indexed=“true” stored=“true”/>
<field name=“date” type=“date” indexed=“true” stored=“true”/>
<field name=“source” type=“text” indexed=“true” stored=“true”/>
Would anyone please be kind enough to give me a bit of advice? Have I done
this right?
Regards,
James
--
View this message in context: http://lucene.472066.n3.nabble.com/Newbie-Tries-to-make-a-Schema-xml-tp3974200.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Newbie Tries to make a Schema.xml
Posted by Spadez <ja...@hotmail.com>.
Thank you for the feedback. Yes they are uses for geospacial. After doing a
bit of homework I found this correction. Is this how it should be done?
<field name="lat" type="tdouble" indexed="true" stored="true"/>
<field name="lon" type="tdouble" indexed="true" stored="true"/>
--
View this message in context: http://lucene.472066.n3.nabble.com/Newbie-tries-to-make-a-Schema-xml-tp3974200p3975458.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Newbie Tries to make a Schema.xml
Posted by Lance Norskog <go...@gmail.com>.
There is a lat/long type and geosearch queries for it. Did you plan to
use that? See the solr/example schemas for use of geosearch.
On Wed, May 9, 2012 at 6:59 AM, Spadez <ja...@hotmail.com> wrote:
> Hi,
>
> I’m totally out of my depth here but I am trying, so I apologise if this is
> a bit of a basic question. I need the following information to be indexed
> and then made searchable by Solr:
>
> Title – A title for the company
> Company – The name of the company
> Description – A description of the company
> Location – The text location of a company (e.g London)
> Longitudinal – The numerical longitudinal reference for spatial searching
> Latitudinal – The numerical latitudinal reference for spatial searching
> Date – The date that the record was added
> Source – The name of the site where this data was collected from
>
> From this, I made this very basic schema.xml:
>
> <uniqueKey>id</uniqueKey>
> <defaultSearchField>title</defaultSearchField>
> <solrQueryParser defaultOperator=“OR”/>
>
> <field name=“id” type=“string” indexed=“true” stored=“true”/>
> <field name=“title” type=“text” indexed=“true” stored=“true”/>
> <field name=“description” type=“text” indexed=“true” stored=“true”/>
> <field name=“company” type=“text” indexed=“true” stored=“true”/>
> <field name=“location_name” type=“text” indexed=“true” stored=“true”/>
> <field name=“longitudinal” type=“string” indexed=“true” stored=“true”/>
> <field name=“latidudinal” type=“string” indexed=“true” stored=“true”/>
> <field name=“date” type=“date” indexed=“true” stored=“true”/>
> <field name=“source” type=“text” indexed=“true” stored=“true”/>
>
> Would anyone please be kind enough to give me a bit of advice? Have I done
> this right?
>
> Regards,
>
> James
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Newbie-Tries-to-make-a-Schema-xml-tp3974200.html
> Sent from the Solr - User mailing list archive at Nabble.com.
--
Lance Norskog
goksron@gmail.com
Re: Newbie Tries to make a Schema.xml
Posted by Erick Erickson <er...@gmail.com>.
You're on the right track. In the default schemas it's kind of tricky. You
see the bit of the "location" definition as:
subFieldSuffix="_coordinate"
And later, you see:
<dynamicField name="*_coordinate" type="tdouble" indexed="true"
stored="false"/>
So the latlng_0/latlng_1 _coordinate fields are created by this
dynamic field mapping.
You can either leave the dynamic field stuff there, or I suppose
create your own. I'd
use the "tdouble" though, presumably the folks who created the example
did it for a
reason....
Best
Erick
On Thu, May 10, 2012 at 5:01 AM, Spadez <ja...@hotmail.com> wrote:
> Right, for Long/Lat I found this information:
>
> <-----Long / Lat Field Type----->
>
> <fieldType name="location" class="solr.LatLonType"
> subFieldSuffix="_coordinate"/>
>
> <-----Fields----->
>
> <field name="latlng" type="location" indexed="true" stored="true" />
> <field name="latlng_0_coordinate" type="double" indexed="true" stored="true"
> />
> <field name="latlng_1_coordinate" type="double" indexed="true" stored="true"
> />
>
> Does this look more logical?
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Newbie-tries-to-make-a-Schema-xml-tp3974200p3976539.html
> Sent from the Solr - User mailing list archive at Nabble.com.
Re: Newbie Tries to make a Schema.xml
Posted by Spadez <ja...@hotmail.com>.
Right, for Long/Lat I found this information:
<-----Long / Lat Field Type----->
<fieldType name="location" class="solr.LatLonType"
subFieldSuffix="_coordinate"/>
<-----Fields----->
<field name="latlng" type="location" indexed="true" stored="true" />
<field name="latlng_0_coordinate" type="double" indexed="true" stored="true"
/>
<field name="latlng_1_coordinate" type="double" indexed="true" stored="true"
/>
Does this look more logical?
--
View this message in context: http://lucene.472066.n3.nabble.com/Newbie-tries-to-make-a-Schema-xml-tp3974200p3976539.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Newbie Tries to make a Schema.xml
Posted by Lance Norskog <go...@gmail.com>.
The files in solr/example/solr/conf are an example of how to do a
schema. You want the 'location' type for your lat/long data. This is
one field storing both values with some custom geographic search code.
On Wed, May 9, 2012 at 10:28 PM, Jack Krupansky <ja...@basetechnology.com> wrote:
> And you will have to define a "text" field type, or use one of the existing
> text field types, such as "text_general" in the example Solr schema.
>
> -- Jack Krupansky
>
> -----Original Message----- From: Spadez
> Sent: Wednesday, May 09, 2012 9:59 AM
> To: solr-user@lucene.apache.org
> Subject: Newbie Tries to make a Schema.xml
>
>
> Hi,
>
> I’m totally out of my depth here but I am trying, so I apologise if this is
> a bit of a basic question. I need the following information to be indexed
> and then made searchable by Solr:
>
> Title – A title for the company
> Company – The name of the company
> Description – A description of the company
> Location – The text location of a company (e.g London)
> Longitudinal – The numerical longitudinal reference for spatial searching
> Latitudinal – The numerical latitudinal reference for spatial searching
> Date – The date that the record was added
> Source – The name of the site where this data was collected from
>
> From this, I made this very basic schema.xml:
>
> <uniqueKey>id</uniqueKey>
> <defaultSearchField>title</defaultSearchField>
> <solrQueryParser defaultOperator=“OR”/>
>
> <field name=“id” type=“string” indexed=“true” stored=“true”/>
> <field name=“title” type=“text” indexed=“true” stored=“true”/>
> <field name=“description” type=“text” indexed=“true” stored=“true”/>
> <field name=“company” type=“text” indexed=“true” stored=“true”/>
> <field name=“location_name” type=“text” indexed=“true” stored=“true”/>
> <field name=“longitudinal” type=“string” indexed=“true” stored=“true”/>
> <field name=“latidudinal” type=“string” indexed=“true” stored=“true”/>
> <field name=“date” type=“date” indexed=“true” stored=“true”/>
> <field name=“source” type=“text” indexed=“true” stored=“true”/>
>
> Would anyone please be kind enough to give me a bit of advice? Have I done
> this right?
>
> Regards,
>
> James
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Newbie-Tries-to-make-a-Schema-xml-tp3974200.html
> Sent from the Solr - User mailing list archive at Nabble.com.
--
Lance Norskog
goksron@gmail.com
Re: Newbie Tries to make a Schema.xml
Posted by Jack Krupansky <ja...@basetechnology.com>.
And you will have to define a "text" field type, or use one of the existing
text field types, such as "text_general" in the example Solr schema.
-- Jack Krupansky
-----Original Message-----
From: Spadez
Sent: Wednesday, May 09, 2012 9:59 AM
To: solr-user@lucene.apache.org
Subject: Newbie Tries to make a Schema.xml
Hi,
I’m totally out of my depth here but I am trying, so I apologise if this is
a bit of a basic question. I need the following information to be indexed
and then made searchable by Solr:
Title – A title for the company
Company – The name of the company
Description – A description of the company
Location – The text location of a company (e.g London)
Longitudinal – The numerical longitudinal reference for spatial searching
Latitudinal – The numerical latitudinal reference for spatial searching
Date – The date that the record was added
Source – The name of the site where this data was collected from
>From this, I made this very basic schema.xml:
<uniqueKey>id</uniqueKey>
<defaultSearchField>title</defaultSearchField>
<solrQueryParser defaultOperator=“OR”/>
<field name=“id” type=“string” indexed=“true” stored=“true”/>
<field name=“title” type=“text” indexed=“true” stored=“true”/>
<field name=“description” type=“text” indexed=“true” stored=“true”/>
<field name=“company” type=“text” indexed=“true” stored=“true”/>
<field name=“location_name” type=“text” indexed=“true” stored=“true”/>
<field name=“longitudinal” type=“string” indexed=“true” stored=“true”/>
<field name=“latidudinal” type=“string” indexed=“true” stored=“true”/>
<field name=“date” type=“date” indexed=“true” stored=“true”/>
<field name=“source” type=“text” indexed=“true” stored=“true”/>
Would anyone please be kind enough to give me a bit of advice? Have I done
this right?
Regards,
James
--
View this message in context:
http://lucene.472066.n3.nabble.com/Newbie-Tries-to-make-a-Schema-xml-tp3974200.html
Sent from the Solr - User mailing list archive at Nabble.com.