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 Fergus McDowall <fe...@gmail.com> on 2012/01/25 17:10:33 UTC

What is the most basic schema.xml you can have for indexing a simple database?

Is it do-able/sensible to build a schema.xml from the ground up?

Say that you are feeding the results of a database query into solr
containing the fields id(int), title(varchar), description(varchar),
pub_date(date) and tags(varchar)

What would be the simplest schema.xml that could support this structure in Solr?

Fergus

Re: What is the most basic schema.xml you can have for indexing a simple database?

Posted by Chris Hostetter <ho...@fucit.org>.
: Yes, refactoring the various example schema.xml's is what i have been 
: doing up to now. The end results is usually quite verbose with a lot of 
: redundancy. What is the most compact possible schema.xml?

>From my Solr OOTB Talk...
http://people.apache.org/~hossman/apachecon2011/

<schema name="minimal" version="1.1">
  <types>
    <fieldType name="string" class="solr.StrField"/>
  </types>
  <fields>
    <dynamicField name="*"       type="string"
                  indexed="true" stored="true" />
  </fields>
  <!-- A good idea, but not strictly neccessary
    <uniqueKey>id</uniqueKey>
    <defaultSearchField>catchall</defaultSearchField>
  -->
</schema>


...that's the most compact possible schema.xml ... works great for 
throwing arbitrary data into solr to see what it looks like and then 
iteratively adding to your schema as you see fit.

-Hoss

Re: What is the most basic schema.xml you can have for indexing a simple database?

Posted by Erick Erickson <er...@gmail.com>.
Fergus:

I have to ask what's driving the push for compactness? General tidiness (of
which I actually approve) or something else?

What is the redundancy you're seeing? Just the fact that some
fieldTypes will contain *almost* the same set of analyzers?

Posting your schema and asking "can we make this smaller" would
make this a much easier question to answer, especially if you added
some indications of what parts you were dissatisfied with.

Best
Erick

On Wed, Jan 25, 2012 at 10:21 AM, Fergus McDowall
<fe...@gmail.com> wrote:
>
> Hi Param
>
> Yes, refactoring the various example schema.xml's is what i have been doing up to now. The end results is usually quite verbose with a lot of redundancy. What is the most compact possible schema.xml?
>
> Thanks for the link!
>
> F
>
> On 25. jan. 2012, at 17:31, "Sethi, Parampreet" <pa...@teamaol.com> wrote:
>
>> Hi Fergus,
>>
>> The schema.xml has declaration of fields as well as analyzers/tokenizers
>> which are required as per the application demand. The easiest way is to
>> modify the schema.xml file which is delivered with
>> <apache_solr>/example/solr/conf.
>>
>> In case you are looking for setting up Solr in front of database with
>> minimal manipulation of DB data, you can check it here
>> http://www.params.me/2011/03/configure-apache-solr-14-with-mysql.html. I
>> am using this setup in of my applications in production.
>>
>> -param
>>
>> On 1/25/12 11:10 AM, "Fergus McDowall" <fe...@gmail.com> wrote:
>>
>>> Is it do-able/sensible to build a schema.xml from the ground up?
>>>
>>> Say that you are feeding the results of a database query into solr
>>> containing the fields id(int), title(varchar), description(varchar),
>>> pub_date(date) and tags(varchar)
>>>
>>> What would be the simplest schema.xml that could support this structure
>>> in Solr?
>>>
>>> Fergus
>>

Re: What is the most basic schema.xml you can have for indexing a simple database?

Posted by Fergus McDowall <fe...@gmail.com>.
Hi Param

Yes, refactoring the various example schema.xml's is what i have been doing up to now. The end results is usually quite verbose with a lot of redundancy. What is the most compact possible schema.xml?

Thanks for the link!

F

On 25. jan. 2012, at 17:31, "Sethi, Parampreet" <pa...@teamaol.com> wrote:

> Hi Fergus,
> 
> The schema.xml has declaration of fields as well as analyzers/tokenizers
> which are required as per the application demand. The easiest way is to
> modify the schema.xml file which is delivered with
> <apache_solr>/example/solr/conf.
> 
> In case you are looking for setting up Solr in front of database with
> minimal manipulation of DB data, you can check it here
> http://www.params.me/2011/03/configure-apache-solr-14-with-mysql.html. I
> am using this setup in of my applications in production.
> 
> -param
> 
> On 1/25/12 11:10 AM, "Fergus McDowall" <fe...@gmail.com> wrote:
> 
>> Is it do-able/sensible to build a schema.xml from the ground up?
>> 
>> Say that you are feeding the results of a database query into solr
>> containing the fields id(int), title(varchar), description(varchar),
>> pub_date(date) and tags(varchar)
>> 
>> What would be the simplest schema.xml that could support this structure
>> in Solr?
>> 
>> Fergus
> 

Re: What is the most basic schema.xml you can have for indexing a simple database?

Posted by "Sethi, Parampreet" <pa...@teamaol.com>.
Hi Fergus,

The schema.xml has declaration of fields as well as analyzers/tokenizers
which are required as per the application demand. The easiest way is to
modify the schema.xml file which is delivered with
<apache_solr>/example/solr/conf.

In case you are looking for setting up Solr in front of database with
minimal manipulation of DB data, you can check it here
http://www.params.me/2011/03/configure-apache-solr-14-with-mysql.html. I
am using this setup in of my applications in production.

-param

On 1/25/12 11:10 AM, "Fergus McDowall" <fe...@gmail.com> wrote:

>Is it do-able/sensible to build a schema.xml from the ground up?
>
>Say that you are feeding the results of a database query into solr
>containing the fields id(int), title(varchar), description(varchar),
>pub_date(date) and tags(varchar)
>
>What would be the simplest schema.xml that could support this structure
>in Solr?
>
>Fergus