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 Marco Westermann <mw...@intersales.de> on 2009/08/18 17:09:41 UTC
dynamic changes to schema
Hi there,
is there a possibility to change the solr-schema over php dynamically.
The web-application I want to index at the moment has the feature to add
fields to entitys and you can tell this fields that they are searchable.
To realize this with solr the schema has to change when a searchable
field is added or removed.
Any suggestions,
Thanks a lot,
Marco Westermann
--
++ Business-Software aus einer Hand ++
++ Internet, Warenwirtschaft, Linux, Virtualisierung ++
http://www.intersales.de
http://www.eisxen.org
http://www.tarantella-partner.de
http://www.medisales.de
http://www.eisfair.net
interSales AG Internet Commerce
Subbelrather Str. 247
50825 Köln
Tel 02 21 - 27 90 50
Fax 02 21 - 27 90 517
Mail info@intersales.de
Mail mw@intersales.de
Web www.intersales.de
Handelsregister Köln HR B 30904
Ust.-Id.: DE199672015
Finanzamt Köln-Nord. UstID: nicht vergeben
Aufsichtsratsvorsitzender: Michael Morgenstern
Vorstand: Andrej Radonic, Peter Zander
Re: dynamic changes to schema
Posted by Constantijn Visinescu <ba...@gmail.com>.
There's that or you can just change the user entered "my_author" field into
"my_author_customattribute" in code after the user has entered it and add a
*_customattribute to your schema.
you'd have to add the postfix in code also at querytime and off you go.
Constantijn
On Wed, Aug 19, 2009 at 11:52 PM, Erik Hatcher <er...@gmail.com>wrote:
> However, you can have a dynamic "*" field mapping that catches all field
> names that aren't already defined - though all of the fields will be the
> same field type.
>
> Erik
>
>
>
>
> On Aug 19, 2009, at 5:48 PM, Marco Westermann wrote:
>
> Hi, thanks for your answers, I think I have to go more in deatail.
>>
>> we are talking about a shop-application which have products I want to
>> search for. This products normally have the standard attributes like sku, a
>> name, a price and so on. But the user can add attributes to the product. So
>> for example if he sells books, he could add the author as attribute. Lets
>> say he name this field my_author (but he is free to name it as he wants) and
>> he tells this field over the configuration, that it is searchable. So I
>> need a field in solr for the author. Cause I cant restrict the user to
>> prefix every field with something like my_ dynamic fields doesn't work, do
>> they?
>>
>> best,
>> Marco
>>
>> Constantijn Visinescu schrieb:
>>
>>> huh? I think I lost you :)
>>> You want to use a multivalued field to list what dynamic fields you have
>>> in
>>> your document?
>>>
>>> Also if you program your application correctly you should be able to
>>> restrict your users from doing anything you please (or don't please in
>>> this
>>> case).
>>>
>>>
>>> On Tue, Aug 18, 2009 at 11:38 PM, Marco Westermann <mw...@intersales.de>
>>> wrote:
>>>
>>>
>>> hi,
>>>>
>>>> thanks for the advise but the problem with dynamic fields is, that i
>>>> cannot
>>>> restrict how the user calls the field in the application. So there isn't
>>>> a
>>>> pattern I can use. But I thought about using mulitvalued fields for the
>>>> dynamically added fields. Good Idea?
>>>>
>>>> thanks,
>>>> Marco
>>>>
>>>> Constantijn Visinescu schrieb:
>>>>
>>>>
>>>> use a dynamic field ?
>>>>>
>>>>> On Tue, Aug 18, 2009 at 5:09 PM, Marco Westermann <mw...@intersales.de>
>>>>> wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Hi there,
>>>>>>
>>>>>> is there a possibility to change the solr-schema over php dynamically.
>>>>>> The
>>>>>> web-application I want to index at the moment has the feature to add
>>>>>> fields
>>>>>> to entitys and you can tell this fields that they are searchable. To
>>>>>> realize
>>>>>> this with solr the schema has to change when a searchable field is
>>>>>> added
>>>>>> or
>>>>>> removed.
>>>>>>
>>>>>> Any suggestions,
>>>>>>
>>>>>> Thanks a lot,
>>>>>>
>>>>>> Marco Westermann
>>>>>>
>>>>>>
Re: dynamic changes to schema
Posted by Erik Hatcher <er...@gmail.com>.
However, you can have a dynamic "*" field mapping that catches all
field names that aren't already defined - though all of the fields
will be the same field type.
Erik
On Aug 19, 2009, at 5:48 PM, Marco Westermann wrote:
> Hi, thanks for your answers, I think I have to go more in deatail.
>
> we are talking about a shop-application which have products I want
> to search for. This products normally have the standard attributes
> like sku, a name, a price and so on. But the user can add attributes
> to the product. So for example if he sells books, he could add the
> author as attribute. Lets say he name this field my_author (but he
> is free to name it as he wants) and he tells this field over the
> configuration, that it is searchable. So I need a field in solr for
> the author. Cause I cant restrict the user to prefix every field
> with something like my_ dynamic fields doesn't work, do they?
>
> best,
> Marco
>
> Constantijn Visinescu schrieb:
>> huh? I think I lost you :)
>> You want to use a multivalued field to list what dynamic fields you
>> have in
>> your document?
>>
>> Also if you program your application correctly you should be able to
>> restrict your users from doing anything you please (or don't please
>> in this
>> case).
>>
>>
>> On Tue, Aug 18, 2009 at 11:38 PM, Marco Westermann
>> <mw...@intersales.de> wrote:
>>
>>
>>> hi,
>>>
>>> thanks for the advise but the problem with dynamic fields is, that
>>> i cannot
>>> restrict how the user calls the field in the application. So there
>>> isn't a
>>> pattern I can use. But I thought about using mulitvalued fields
>>> for the
>>> dynamically added fields. Good Idea?
>>>
>>> thanks,
>>> Marco
>>>
>>> Constantijn Visinescu schrieb:
>>>
>>>
>>>> use a dynamic field ?
>>>>
>>>> On Tue, Aug 18, 2009 at 5:09 PM, Marco Westermann
>>>> <mw...@intersales.de>
>>>> wrote:
>>>>
>>>>
>>>>
>>>>
>>>>> Hi there,
>>>>>
>>>>> is there a possibility to change the solr-schema over php
>>>>> dynamically.
>>>>> The
>>>>> web-application I want to index at the moment has the feature to
>>>>> add
>>>>> fields
>>>>> to entitys and you can tell this fields that they are
>>>>> searchable. To
>>>>> realize
>>>>> this with solr the schema has to change when a searchable field
>>>>> is added
>>>>> or
>>>>> removed.
>>>>>
>>>>> Any suggestions,
>>>>>
>>>>> Thanks a lot,
>>>>>
>>>>> Marco Westermann
>>>>>
Re: dynamic changes to schema
Posted by Marco Westermann <mw...@intersales.de>.
Hi, thanks for your answers, I think I have to go more in deatail.
we are talking about a shop-application which have products I want to
search for. This products normally have the standard attributes like
sku, a name, a price and so on. But the user can add attributes to the
product. So for example if he sells books, he could add the author as
attribute. Lets say he name this field my_author (but he is free to name
it as he wants) and he tells this field over the configuration, that it
is searchable. So I need a field in solr for the author. Cause I cant
restrict the user to prefix every field with something like my_ dynamic
fields doesn't work, do they?
best,
Marco
Constantijn Visinescu schrieb:
> huh? I think I lost you :)
> You want to use a multivalued field to list what dynamic fields you have in
> your document?
>
> Also if you program your application correctly you should be able to
> restrict your users from doing anything you please (or don't please in this
> case).
>
>
> On Tue, Aug 18, 2009 at 11:38 PM, Marco Westermann <mw...@intersales.de> wrote:
>
>
>> hi,
>>
>> thanks for the advise but the problem with dynamic fields is, that i cannot
>> restrict how the user calls the field in the application. So there isn't a
>> pattern I can use. But I thought about using mulitvalued fields for the
>> dynamically added fields. Good Idea?
>>
>> thanks,
>> Marco
>>
>> Constantijn Visinescu schrieb:
>>
>>
>>> use a dynamic field ?
>>>
>>> On Tue, Aug 18, 2009 at 5:09 PM, Marco Westermann <mw...@intersales.de>
>>> wrote:
>>>
>>>
>>>
>>>
>>>> Hi there,
>>>>
>>>> is there a possibility to change the solr-schema over php dynamically.
>>>> The
>>>> web-application I want to index at the moment has the feature to add
>>>> fields
>>>> to entitys and you can tell this fields that they are searchable. To
>>>> realize
>>>> this with solr the schema has to change when a searchable field is added
>>>> or
>>>> removed.
>>>>
>>>> Any suggestions,
>>>>
>>>> Thanks a lot,
>>>>
>>>> Marco Westermann
>>>>
>>>> --
>>>> ++ Business-Software aus einer Hand ++
>>>> ++ Internet, Warenwirtschaft, Linux, Virtualisierung ++
>>>> http://www.intersales.de
>>>> http://www.eisxen.org
>>>> http://www.tarantella-partner.de
>>>> http://www.medisales.de
>>>> http://www.eisfair.net
>>>>
>>>> interSales AG Internet Commerce
>>>> Subbelrather Str. 247
>>>> 50825 Köln
>>>>
>>>> Tel 02 21 - 27 90 50
>>>> Fax 02 21 - 27 90 517
>>>> Mail info@intersales.de
>>>> Mail mw@intersales.de
>>>> Web www.intersales.de
>>>>
>>>> Handelsregister Köln HR B 30904
>>>> Ust.-Id.: DE199672015
>>>> Finanzamt Köln-Nord. UstID: nicht vergeben
>>>> Aufsichtsratsvorsitzender: Michael Morgenstern
>>>> Vorstand: Andrej Radonic, Peter Zander
>>>>
>>>>
>>>>
>>>>
>>>
>>> __________ Hinweis von ESET NOD32 Antivirus, Signaturdatenbank-Version
>>> 4346 (20090818) __________
>>>
>>> E-Mail wurde geprüft mit ESET NOD32 Antivirus.
>>>
>>> http://www.eset.com
>>>
>>>
>>>
>>>
>>>
>> --
>> ++ Business-Software aus einer Hand ++
>> ++ Internet, Warenwirtschaft, Linux, Virtualisierung ++
>> http://www.intersales.de
>> http://www.eisxen.org
>> http://www.tarantella-partner.de
>> http://www.medisales.de
>> http://www.eisfair.net
>>
>> interSales AG Internet Commerce
>> Subbelrather Str. 247
>> 50825 Köln
>>
>> Tel 02 21 - 27 90 50
>> Fax 02 21 - 27 90 517
>> Mail info@intersales.de
>> Mail mw@intersales.de
>> Web www.intersales.de
>>
>> Handelsregister Köln HR B 30904
>> Ust.-Id.: DE199672015
>> Finanzamt Köln-Nord. UstID: nicht vergeben
>> Aufsichtsratsvorsitzender: Michael Morgenstern
>> Vorstand: Andrej Radonic, Peter Zander
>>
>>
>
>
>
> __________ Hinweis von ESET NOD32 Antivirus, Signaturdatenbank-Version 4346 (20090818) __________
>
> E-Mail wurde geprüft mit ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>
--
++ Business-Software aus einer Hand ++
++ Internet, Warenwirtschaft, Linux, Virtualisierung ++
http://www.intersales.de
http://www.eisxen.org
http://www.tarantella-partner.de
http://www.medisales.de
http://www.eisfair.net
interSales AG Internet Commerce
Subbelrather Str. 247
50825 Köln
Tel 02 21 - 27 90 50
Fax 02 21 - 27 90 517
Mail info@intersales.de
Mail mw@intersales.de
Web www.intersales.de
Handelsregister Köln HR B 30904
Ust.-Id.: DE199672015
Finanzamt Köln-Nord. UstID: nicht vergeben
Aufsichtsratsvorsitzender: Michael Morgenstern
Vorstand: Andrej Radonic, Peter Zander
Re: dynamic changes to schema
Posted by Constantijn Visinescu <ba...@gmail.com>.
huh? I think I lost you :)
You want to use a multivalued field to list what dynamic fields you have in
your document?
Also if you program your application correctly you should be able to
restrict your users from doing anything you please (or don't please in this
case).
On Tue, Aug 18, 2009 at 11:38 PM, Marco Westermann <mw...@intersales.de> wrote:
> hi,
>
> thanks for the advise but the problem with dynamic fields is, that i cannot
> restrict how the user calls the field in the application. So there isn't a
> pattern I can use. But I thought about using mulitvalued fields for the
> dynamically added fields. Good Idea?
>
> thanks,
> Marco
>
> Constantijn Visinescu schrieb:
>
>> use a dynamic field ?
>>
>> On Tue, Aug 18, 2009 at 5:09 PM, Marco Westermann <mw...@intersales.de>
>> wrote:
>>
>>
>>
>>> Hi there,
>>>
>>> is there a possibility to change the solr-schema over php dynamically.
>>> The
>>> web-application I want to index at the moment has the feature to add
>>> fields
>>> to entitys and you can tell this fields that they are searchable. To
>>> realize
>>> this with solr the schema has to change when a searchable field is added
>>> or
>>> removed.
>>>
>>> Any suggestions,
>>>
>>> Thanks a lot,
>>>
>>> Marco Westermann
>>>
>>> --
>>> ++ Business-Software aus einer Hand ++
>>> ++ Internet, Warenwirtschaft, Linux, Virtualisierung ++
>>> http://www.intersales.de
>>> http://www.eisxen.org
>>> http://www.tarantella-partner.de
>>> http://www.medisales.de
>>> http://www.eisfair.net
>>>
>>> interSales AG Internet Commerce
>>> Subbelrather Str. 247
>>> 50825 Köln
>>>
>>> Tel 02 21 - 27 90 50
>>> Fax 02 21 - 27 90 517
>>> Mail info@intersales.de
>>> Mail mw@intersales.de
>>> Web www.intersales.de
>>>
>>> Handelsregister Köln HR B 30904
>>> Ust.-Id.: DE199672015
>>> Finanzamt Köln-Nord. UstID: nicht vergeben
>>> Aufsichtsratsvorsitzender: Michael Morgenstern
>>> Vorstand: Andrej Radonic, Peter Zander
>>>
>>>
>>>
>>
>>
>>
>> __________ Hinweis von ESET NOD32 Antivirus, Signaturdatenbank-Version
>> 4346 (20090818) __________
>>
>> E-Mail wurde geprüft mit ESET NOD32 Antivirus.
>>
>> http://www.eset.com
>>
>>
>>
>>
>
>
> --
> ++ Business-Software aus einer Hand ++
> ++ Internet, Warenwirtschaft, Linux, Virtualisierung ++
> http://www.intersales.de
> http://www.eisxen.org
> http://www.tarantella-partner.de
> http://www.medisales.de
> http://www.eisfair.net
>
> interSales AG Internet Commerce
> Subbelrather Str. 247
> 50825 Köln
>
> Tel 02 21 - 27 90 50
> Fax 02 21 - 27 90 517
> Mail info@intersales.de
> Mail mw@intersales.de
> Web www.intersales.de
>
> Handelsregister Köln HR B 30904
> Ust.-Id.: DE199672015
> Finanzamt Köln-Nord. UstID: nicht vergeben
> Aufsichtsratsvorsitzender: Michael Morgenstern
> Vorstand: Andrej Radonic, Peter Zander
>
Re: dynamic changes to schema
Posted by Marco Westermann <mw...@intersales.de>.
hi,
thanks for the advise but the problem with dynamic fields is, that i
cannot restrict how the user calls the field in the application. So
there isn't a pattern I can use. But I thought about using mulitvalued
fields for the dynamically added fields. Good Idea?
thanks,
Marco
Constantijn Visinescu schrieb:
> use a dynamic field ?
>
> On Tue, Aug 18, 2009 at 5:09 PM, Marco Westermann <mw...@intersales.de> wrote:
>
>
>> Hi there,
>>
>> is there a possibility to change the solr-schema over php dynamically. The
>> web-application I want to index at the moment has the feature to add fields
>> to entitys and you can tell this fields that they are searchable. To realize
>> this with solr the schema has to change when a searchable field is added or
>> removed.
>>
>> Any suggestions,
>>
>> Thanks a lot,
>>
>> Marco Westermann
>>
>> --
>> ++ Business-Software aus einer Hand ++
>> ++ Internet, Warenwirtschaft, Linux, Virtualisierung ++
>> http://www.intersales.de
>> http://www.eisxen.org
>> http://www.tarantella-partner.de
>> http://www.medisales.de
>> http://www.eisfair.net
>>
>> interSales AG Internet Commerce
>> Subbelrather Str. 247
>> 50825 Köln
>>
>> Tel 02 21 - 27 90 50
>> Fax 02 21 - 27 90 517
>> Mail info@intersales.de
>> Mail mw@intersales.de
>> Web www.intersales.de
>>
>> Handelsregister Köln HR B 30904
>> Ust.-Id.: DE199672015
>> Finanzamt Köln-Nord. UstID: nicht vergeben
>> Aufsichtsratsvorsitzender: Michael Morgenstern
>> Vorstand: Andrej Radonic, Peter Zander
>>
>>
>
>
>
> __________ Hinweis von ESET NOD32 Antivirus, Signaturdatenbank-Version 4346 (20090818) __________
>
> E-Mail wurde geprüft mit ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>
--
++ Business-Software aus einer Hand ++
++ Internet, Warenwirtschaft, Linux, Virtualisierung ++
http://www.intersales.de
http://www.eisxen.org
http://www.tarantella-partner.de
http://www.medisales.de
http://www.eisfair.net
interSales AG Internet Commerce
Subbelrather Str. 247
50825 Köln
Tel 02 21 - 27 90 50
Fax 02 21 - 27 90 517
Mail info@intersales.de
Mail mw@intersales.de
Web www.intersales.de
Handelsregister Köln HR B 30904
Ust.-Id.: DE199672015
Finanzamt Köln-Nord. UstID: nicht vergeben
Aufsichtsratsvorsitzender: Michael Morgenstern
Vorstand: Andrej Radonic, Peter Zander
Re: dynamic changes to schema
Posted by Constantijn Visinescu <ba...@gmail.com>.
use a dynamic field ?
On Tue, Aug 18, 2009 at 5:09 PM, Marco Westermann <mw...@intersales.de> wrote:
> Hi there,
>
> is there a possibility to change the solr-schema over php dynamically. The
> web-application I want to index at the moment has the feature to add fields
> to entitys and you can tell this fields that they are searchable. To realize
> this with solr the schema has to change when a searchable field is added or
> removed.
>
> Any suggestions,
>
> Thanks a lot,
>
> Marco Westermann
>
> --
> ++ Business-Software aus einer Hand ++
> ++ Internet, Warenwirtschaft, Linux, Virtualisierung ++
> http://www.intersales.de
> http://www.eisxen.org
> http://www.tarantella-partner.de
> http://www.medisales.de
> http://www.eisfair.net
>
> interSales AG Internet Commerce
> Subbelrather Str. 247
> 50825 Köln
>
> Tel 02 21 - 27 90 50
> Fax 02 21 - 27 90 517
> Mail info@intersales.de
> Mail mw@intersales.de
> Web www.intersales.de
>
> Handelsregister Köln HR B 30904
> Ust.-Id.: DE199672015
> Finanzamt Köln-Nord. UstID: nicht vergeben
> Aufsichtsratsvorsitzender: Michael Morgenstern
> Vorstand: Andrej Radonic, Peter Zander
>