Updating Solr schema doesn't work

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Updating Solr schema doesn't work

amruth
Hello,

I am running SolrCloud 6.6.0 and trying to add new fields to Solr Schema. I
have added fields to /var/solr/data/collection1/conf/managed-schema and
executed,

*- /opt/zookeeper/bin/zkCli.sh delete /configs/collection1/managed-schema
- /opt/zookeeper/bin/zkCli.sh create /configs/collection1/managed-schema
"`cat /var/solr/data/collection1/conf/managed-schema`"*

I could see fields on managed-schema on Solr UI and when I start deltas and
query, I am not able to see those fields in the result set.

Please let me know if this is the way to update schema in SolrCloud



--
Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Reply | Threaded
Open this post in threaded view
|

Re: Updating Solr schema doesn't work

Shawn Heisey-2
On 10/4/2019 10:22 AM, amruth wrote:
> *- /opt/zookeeper/bin/zkCli.sh delete
> /configs/collection1/managed-schema - /opt/zookeeper/bin/zkCli.sh
> create /configs/collection1/managed-schema "`cat
> /var/solr/data/collection1/conf/managed-schema`"*
>
> I could see fields on managed-schema on Solr UI and when I start
> deltas and query, I am not able to see those fields in the result
> set.

In order to see fields in the result set, the field must either be
stored, or it must have docValues defined and be set to use docValues as
stored.  And that field must be present when documents in the result set
are indexed.

If you did not reindex your documents, with the new fields added, then
you will not see those fields in results when those documents are in the
result set.

> Please let me know if this is the way to update schema in SolrCloud

It's probably not the way I would do it.  I would update a local copy of
the config and then re-upload the entire config rather than dealing with
a single file.

I do not know how the zkCli.sh included with zookeeper works, so I do
not know if those are correct commands.  I know how the zkcli.sh script
included with Solr works.

Thanks,
Shawn
Reply | Threaded
Open this post in threaded view
|

Re: Updating Solr schema doesn't work

Shawn Heisey-2
On 10/4/2019 2:45 PM, Shawn Heisey wrote:
> It's probably not the way I would do it.  I would update a local copy of
> the config and then re-upload the entire config rather than dealing with
> a single file.

You will also need to reload the collection or restart Solr, and then as
already mentioned, reindex your documents with the new fields or index
some new ones with the new fields.

Thanks,
Shawn