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 bengates <be...@aliceadsl.fr> on 2013/09/03 11:09:30 UTC

Update field properties via Schema Rest API ?

Hello,

I'm pretty new to Solr, as a PHP developer. 
I'm still reading the tutorials for getting started with Solr, adding and
indexing data. I'm still using the example/start.jar, as I still didn't
succeed to config a true (production-ready) Solr instance. But doesn't
matter.

As I can't deal with Java, Tomcat etc, I just want to do the maximum things
with the REST API, for not having to edit any file.

I have needs in adding and editing fields frequently, so I use the Schema
Rest API.
However, the wiki http://wiki.apache.org/solr/SchemaRESTAPI explains how to
add fields, but not to update or delete them.

Can you help me ?

I really need to control (e.g. update) the properties of my fields (indexed,
stored, multiValued, etc) via the REST API, without having to edit any file
each time I need an update.

Thanks,
Ben



--
View this message in context: http://lucene.472066.n3.nabble.com/Update-field-properties-via-Schema-Rest-API-tp4087907.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Update field properties via Schema Rest API ?

Posted by Upayavira <uv...@odoko.co.uk>.
Updating a field isn't straightforward. Changing size from string to int
would, if you don't re-index, break your index. The schema tells Slr how
to interpret the binary bits it finds in the index. If there are no bits
in the index for that field name, then no issue. If there already are
bits in the index, changing the schema will cause Solr to get confused
when those bits are returned from the index in the results of a query.

It seems to me that you could get away with using dynamic fields. Start
with size_s, which is a string field. Then, start adding a size_i field
to your index. It is a new field containing the integer version. Because
of the dynamic fields definitions in the schema, these fields would not
require schema editing or core reloads.

If you, however, want every document in tier index to have the integer
size value, you will need to update those documents, adding that new
field(and skipping/removing the string one if no-longer needed).

Hope this helps.

Upayavira

On Sat, Sep 28, 2013, at 04:38 PM, bengates wrote:
> Haha,
> 
> Thanks for your reply, that's what I'll do then.
> 
> Unfortunately I can speak Java as well as I can speak ancient Chinese in
> Sign Language... ^^
> 
> 
> 
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Update-field-properties-via-Schema-Rest-API-tp4087907p4092507.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: Update field properties via Schema Rest API ?

Posted by bengates <be...@aliceadsl.fr>.
Haha,

Thanks for your reply, that's what I'll do then.

Unfortunately I can speak Java as well as I can speak ancient Chinese in
Sign Language... ^^



--
View this message in context: http://lucene.472066.n3.nabble.com/Update-field-properties-via-Schema-Rest-API-tp4087907p4092507.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Update field properties via Schema Rest API ?

Posted by Erick Erickson <er...@gmail.com>.
Well, you can always raise a JIRA, I'm about to raise a related one.

And a JIRA with a patch (it is open-source, after all) is even
better ;)

Best,
Erick

On Sat, Sep 28, 2013 at 6:44 AM, bengates <be...@aliceadsl.fr> wrote:
> By the way,
>
> Is there a place where we can post our feature requests on Solr ?
>
> Besides this one, it would be great to be able to tell Solr in the
> schema.xml, that the default value of a field, is the value of another
> field, instead of a static value.
>
> Best,
> Ben
>
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Update-field-properties-via-Schema-Rest-API-tp4087907p4092481.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: Update field properties via Schema Rest API ?

Posted by bengates <be...@aliceadsl.fr>.
By the way,

Is there a place where we can post our feature requests on Solr ?

Besides this one, it would be great to be able to tell Solr in the
schema.xml, that the default value of a field, is the value of another
field, instead of a static value.

Best,
Ben




--
View this message in context: http://lucene.472066.n3.nabble.com/Update-field-properties-via-Schema-Rest-API-tp4087907p4092481.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Update field properties via Schema Rest API ?

Posted by bengates <be...@aliceadsl.fr>.
Hello Erick,

Thank you for your reply.

Unfortunately, yes it is.

I work with a company that has a catalog with many new attributes every day,
and sometimes the existing ones change. For instance, one attribute may live
with the unit for months (e.g. screen_size ="32 cm") and one day my provider
change it to an integer (screen_size = 32), making it easier to create
ranges.

Besides I want my business users to be able to add and edit new features on
their products, and my php middle-end app just should communicate with solr
without me.

We actually work with a solution that works that way (users do everything,
the middle-app controls the users' inputs and deals with the back-end), and
dealing with the open-source solr is really hard if that essential feature
isn't provided... :(

That's why I was very happy when Solr 4.4 introduced the add field by the
REST API, that works very well, but I was disapointed that any new field
couldn't be edited (just "indexed" and "stored" true / false would be
amazing) without I have to edit any file.

So I really hope this part of the API will soon be completed :)

Best regards,
Ben



--
View this message in context: http://lucene.472066.n3.nabble.com/Update-field-properties-via-Schema-Rest-API-tp4087907p4087951.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Update field properties via Schema Rest API ?

Posted by Erick Erickson <er...@gmail.com>.
Is editing a text file really all that onerous? You can edit the
schema.xml file with any editor you're comfortable with and
issue the core RELOAD command in the interim.

Best
Erick


On Tue, Sep 3, 2013 at 6:20 AM, bengates <be...@aliceadsl.fr> wrote:

> Hello,
>
> Thanks for your quick reply.
>
> This is what I feared.
> Do you know if this is planned for Solr 4.5 or Solr 5.0 ?
> I didn't see anything about it in the roadmap.
>
> Thank you,
> Ben
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Update-field-properties-via-Schema-Rest-API-tp4087907p4087920.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: Update field properties via Schema Rest API ?

Posted by bengates <be...@aliceadsl.fr>.
Hello,

Thanks for your quick reply.

This is what I feared.
Do you know if this is planned for Solr 4.5 or Solr 5.0 ? 
I didn't see anything about it in the roadmap.

Thank you,
Ben



--
View this message in context: http://lucene.472066.n3.nabble.com/Update-field-properties-via-Schema-Rest-API-tp4087907p4087920.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Update field properties via Schema Rest API ?

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
The Schema REST API is a new feature and supports only adding fields
(and that too since Solr 4.4). It doesn't support modifying fields
yet.

On Tue, Sep 3, 2013 at 2:39 PM, bengates <be...@aliceadsl.fr> wrote:
> Hello,
>
> I'm pretty new to Solr, as a PHP developer.
> I'm still reading the tutorials for getting started with Solr, adding and
> indexing data. I'm still using the example/start.jar, as I still didn't
> succeed to config a true (production-ready) Solr instance. But doesn't
> matter.
>
> As I can't deal with Java, Tomcat etc, I just want to do the maximum things
> with the REST API, for not having to edit any file.
>
> I have needs in adding and editing fields frequently, so I use the Schema
> Rest API.
> However, the wiki http://wiki.apache.org/solr/SchemaRESTAPI explains how to
> add fields, but not to update or delete them.
>
> Can you help me ?
>
> I really need to control (e.g. update) the properties of my fields (indexed,
> stored, multiValued, etc) via the REST API, without having to edit any file
> each time I need an update.
>
> Thanks,
> Ben
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Update-field-properties-via-Schema-Rest-API-tp4087907.html
> Sent from the Solr - User mailing list archive at Nabble.com.



-- 
Regards,
Shalin Shekhar Mangar.