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 natasha <na...@factual.com> on 2015/10/30 00:15:21 UTC

Solr 5.3.1 CREATE defaults to schema-less mode Java version 1.7.0_45

Hi,

I just downloaded Solr 5.3.1, and after starting Solr with the following
command:

bin/solr start -p 8985

I attempt to CREATE a Solr-core with the following command:

curl
'http:localhost:8985/solr/admin/cores?action=CREATE&name=test-core&instanceDir=/Users/nw/Downloads/twc-session-dash/collection1'

where twc-session-dash directory has
<collection1>
  <conf>
    schema.xml
    solrconfig.xml
  <data>
     <index>
       _2.fdt
       _2.fnm
       _2_Lucene41_0.doc
       _2_Lucene41_0.tip
       _2.fdx			
       _2.si			
       _2_Lucene41_0.tim	
       segments_4

solrconfig.xml has the following content:
<?xml version='1.0'
encoding='UTF-8'?><config><indexConfig><rabBufferSizeMB>1024</rabBufferSizeMB><maxBufferedDocs>1000</maxBufferedDocs><maxFieldLength>10000</maxFieldLength><deletionPolicy
class="solr.SolrDeletionPolicy"></deletionPolicy></indexConfig><query><maxBooleanClauses>2147483647</maxBooleanClauses></query><lib
dir="/var/apps/solr/lib"></lib><lib dir="./lib"></lib><lib
dir="../lib"></lib><requestDispatcher
handleSelect="true"></requestDispatcher><searchComponent name="terms"
class="solr.TermsComponent"></searchComponent><requestHandler name="/terms"
class="solr.SearchHandler" startup="lazy"><lst name="defaults"><bool
name="terms">true</bool><bool name="distrib">false</bool></lst><arr
name="components"><str>terms</str></arr></requestHandler><requestHandler
name="standard" class="solr.StandardRequestHandler"
default="true"></requestHandler><updateHandler
class="solr.DirectUpdateHandler2"></updateHandler><requestHandler
name="/update"
class="solr.UpdateRequestHandler"></requestHandler><luceneMatchVersion>LUCENE_41</luceneMatchVersion></config>

And see schema.xml at bottom of post:

And the core is ostensibly created without an issue (numDocs is 59, which is
correct and no error logged) But, when I ping the newly created core's
schema via:

curl 'http://localhost:8985/solr/test-core/schema/fields'

Only id, _root_, _text_, and _version_ are returned. When I query a known
field in my schema.xml like _id, I am told "undefined field _id."

The changes to the directory include that Solr 5.3.1 has populated a
core-properties file at the same level as conf and data with content:
#Written by CorePropertiesLocator
#Thu Oct 29 22:53:57 UTC 2015
name=test-core
coreNodeName=core_node1

Added tlog/ at the same level as index, and write.lock within index.

I investigate the Solr Cloud UI, and note that my schema fields as well as
the default fields are mixed together in the Schema Browser dropdown for
test-core. However, the only fields available in the Analyse Fieldname /
FieldType: dropdown in the Analysis tab are the default fields. 

I am running Java version 1.7.0_51 on this machine, which is an openstack
machine.

When I install Solr 5.3.1 on my local machine, which is running Java version
"1.8.0_45" I have no issue. I am able to CREATE the core, I see my and only
my fields when I query the schema, and am able to query these fields no
problem.

Please advise how I can CREATE solr indices on my openstack machine. Thank
you,

<?xml version='1.0' encoding='UTF-8'?><schema name="session"
version="1.5"><types><fieldType class="solr.TrieDateField"
sortMissingLast="true" positionIncrementGap="0" indexed="true"
stored="false" name="date"></fieldType><fieldType name="boolean"
class="solr.BoolField" sortMissingLast="true" omitNorms="true"
termVectors="false"></fieldType><fieldType name="string"
class="solr.StrField" sortMissingLast="true" omitNorms="true"
termVectors="false"></fieldType><fieldType class="solr.TrieField"
sortMissingLast="true" positionIncrementGap="0" indexed="true"
stored="false" type="long" name="int"></fieldType><fieldType
class="solr.TrieField" sortMissingLast="true" positionIncrementGap="0"
indexed="true" stored="false" type="double"
name="double"></fieldType><fieldType name="geo" class="solr.StrField"
sortMissingLast="true" omitNorms="true"
termVectors="false"></fieldType><fieldType class="solr.BinaryField"
name="binary"></fieldType></types><fields><field multiValued="false"
stored="false" indexed="true" name="sess-count-int-3-months"
type="int"></field><field multiValued="false" stored="true" indexed="true"
name="_id" type="string"></field><field multiValued="false" stored="false"
indexed="true" name="input-count-int-1-week" type="int"></field><field
multiValued="true" stored="false" indexed="true" name="sessions-1-month"
type="string"></field><field multiValued="true" stored="false"
indexed="true" name="sessions-1-year" type="string"></field><field
multiValued="false" stored="false" indexed="true"
name="impression-count-int-6-months" type="int"></field><field
multiValued="false" stored="false" indexed="true"
name="device-count-int-1-week" type="int"></field><field multiValued="false"
stored="false" indexed="true" name="impression-count-int-1-year"
type="int"></field><field multiValued="false" stored="false" indexed="true"
name="device-count-int-1-year" type="int"></field><field multiValued="true"
stored="false" indexed="true" name="sessions-3-months"
type="string"></field><field multiValued="true" stored="false"
indexed="true" name="sessions-1-week" type="string"></field><field
multiValued="false" stored="false" indexed="true"
name="device-count-int-2-weeks" type="int"></field><field
multiValued="false" stored="false" indexed="true"
name="input-count-int-6-months" type="int"></field><field
multiValued="false" stored="false" indexed="true"
name="impression-count-int-1-week" type="int"></field><field
multiValued="false" stored="false" indexed="true" name="device-id-6-months"
type="string"></field><field multiValued="false" stored="false"
indexed="true" name="device-count-int-1-month" type="int"></field><field
multiValued="false" stored="false" indexed="true"
name="device-count-int-3-months" type="int"></field><field
multiValued="false" stored="false" indexed="true" name="device-id-1-month"
type="string"></field><field multiValued="false" stored="false"
indexed="true" name="device-id-3-months" type="string"></field><field
multiValued="false" stored="false" indexed="true" name="device-id-2-weeks"
type="string"></field><field multiValued="false" stored="false"
indexed="true" name="input-count-int-1-year" type="int"></field><field
multiValued="false" stored="false" indexed="true"
name="sess-count-int-1-year" type="int"></field><field multiValued="false"
stored="false" indexed="true" name="sess-count-int-6-months"
type="int"></field><field multiValued="false" stored="false" indexed="true"
name="input-count-int-2-weeks" type="int"></field><field multiValued="true"
stored="false" indexed="true" name="sessions-6-months"
type="string"></field><field multiValued="false" stored="false"
indexed="true" name="device-id-1-year" type="string"></field><field
multiValued="false" stored="false" indexed="true"
name="impression-count-int-3-months" type="int"></field><field
multiValued="false" stored="false" indexed="true"
name="impression-count-int-2-weeks" type="int"></field><field
multiValued="false" stored="false" indexed="true"
name="sess-count-int-1-month" type="int"></field><field multiValued="false"
stored="false" indexed="true" name="sess-count-int-1-week"
type="int"></field><field multiValued="true" stored="false" indexed="true"
name="sessions-2-weeks" type="string"></field><field multiValued="false"
stored="false" indexed="true" name="device-id-1-week"
type="string"></field><field multiValued="false" stored="false"
indexed="true" name="input-count-int-3-months" type="int"></field><field
multiValued="false" stored="false" indexed="true"
name="sess-count-int-2-weeks" type="int"></field><field multiValued="false"
stored="false" indexed="true" name="device-count-int-6-months"
type="int"></field><field multiValued="false" stored="false" indexed="true"
name="input-count-int-1-month" type="int"></field><field multiValued="false"
stored="false" indexed="true" name="impression-count-int-1-month"
type="int"></field></fields><defaultSearchField>_id</defaultSearchField><uniqueKey>_id</uniqueKey></schema>



--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-5-3-1-CREATE-defaults-to-schema-less-mode-Java-version-1-7-0-45-tp4237305.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr 5.3.1 CREATE defaults to schema-less mode Java version 1.7.0_45

Posted by natasha <na...@factual.com>.
Hi Erick,

Thanks for your help. I am fairly new to Solr.

I'm not set on using SolrCloud. No need for ZooKeeper or multiple leader
nodes.

What I have is an existing instanceDir (with a conf and data directory,
with all requisite components) and I would like to create a new core based
on this preexisting directory.

To that effect, I am trying to use the SolrAdmin CREATE method. I have Solr
5.3.1 installed on my machine, and am trying to create a core where
instanceDir is a path to the core (also on my machine). Even if I move
instanceDir into the Solr root, I still see that the only fields returned
in the schema are the default fields.

If there is an preferable (non-cloud) way to create a core to point at an
existing instanceDir please advise!

Thank you,
Natasha



On Thu, Oct 29, 2015 at 8:58 PM, Erick Erickson [via Lucene] <
ml-node+s472066n4237322h82@n3.nabble.com> wrote:

> I'm pretty confused about what you're trying to do. You mention using
> the SolrCloud UI to look at your core, but on the other hand you also
> mention using the core admin to create the core.
>
> Trying to use the core admin commands with SolrCloud is a recipe for
> disaster. Under the covers, the _collections_ api does, indeed, use
> the core admin API to create cores, but it really must be precisely
> done. If you're going to try to create your own cores, I recommend
> setting up a non-SolrCloud system.
>
> If you want to use SolrCloud, then I _strongly_ recommend you use the
> collections API to create your collections. You can certainly have a
> single-shard collection that would be a leader-only collection (i.e.
> no followers), which would have only a single core cluster-wide if
> that fits your architecture....
>
> As it is, in cloud mode Solr expects the configs to be up on
> Zookeeper, not resident on disk somewhere. And the admin core create
> command promises that you have the configs in
> /Users/nw/Downloads/twc-session-dash/collection1 which is a recipe for
> confusion on Solr's part...
>
> HTH,
> Erick
>
> On Thu, Oct 29, 2015 at 4:24 PM, natasha <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=4237322&i=0>> wrote:
>
> > Note, if I attempt to CREATE the core using Solr 5.3.0 on my openstack
> > machine (Java version 1.7.0) I have no issues.
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> http://lucene.472066.n3.nabble.com/Solr-5-3-1-CREATE-defaults-to-schema-less-mode-Java-version-1-7-0-45-tp4237305p4237307.html
> > Sent from the Solr - User mailing list archive at Nabble.com.
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://lucene.472066.n3.nabble.com/Solr-5-3-1-CREATE-defaults-to-schema-less-mode-Java-version-1-7-0-45-tp4237305p4237322.html
> To unsubscribe from Solr 5.3.1 CREATE defaults to schema-less mode Java
> version 1.7.0_45, click here
> <http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4237305&code=bmF0YXNoYUBmYWN0dWFsLmNvbXw0MjM3MzA1fDkzODY1MjkzNw==>
> .
> NAML
> <http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-5-3-1-CREATE-defaults-to-schema-less-mode-Java-version-1-7-0-45-tp4237305p4237426.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr 5.3.1 CREATE defaults to schema-less mode Java version 1.7.0_45

Posted by Upayavira <uv...@odoko.co.uk>.

On Fri, Oct 30, 2015, at 07:03 PM, natasha wrote:
> Hi Erick,
> 
> If I just run the following, I have no issue:
> 
> bin/solr start
> curl '
> http://localhost:8983/solr/admin/cores?action=CREATE&name=test-core&instanceDir=/home/natasha/twc-session-dash1/collection1
> <http://localhost:8983/solr/admin/cores?action=CREATE&name=test-core&instanceDir=/home/natasha/twc-sessions-dash/collection1>
> '
> curl 'http://localhost:8983/solr/test-core/schema/fields'
> 
> As opposed to running bin/solr start -e cloud (which spins up an example)
> before I load a core.

Well yes, the -e cloud option is starting it in SolrCloud mode, in which
case you should be using the collections API to create a collection. The
two scenarios above *aren't* the same.

Upayavira

Re: Solr 5.3.1 CREATE defaults to schema-less mode Java version 1.7.0_45

Posted by natasha <na...@factual.com>.
Hi Erick,

If I just run the following, I have no issue:

bin/solr start
curl '
http://localhost:8983/solr/admin/cores?action=CREATE&name=test-core&instanceDir=/home/natasha/twc-session-dash1/collection1
<http://localhost:8983/solr/admin/cores?action=CREATE&name=test-core&instanceDir=/home/natasha/twc-sessions-dash/collection1>
'
curl 'http://localhost:8983/solr/test-core/schema/fields'

As opposed to running bin/solr start -e cloud (which spins up an example)
before I load a core.

Thank you,
Natasha







On Fri, Oct 30, 2015 at 10:24 AM, Natasha Whitney <na...@factual.com>
wrote:

> Hi Erick,
>
> Thanks for your help. I am fairly new to Solr.
>
> I'm not set on using SolrCloud. No need for ZooKeeper or multiple leader
> nodes.
>
> What I have is an existing instanceDir (with a conf and data directory,
> with all requisite components) and I would like to create a new core based
> on this preexisting directory.
>
> To that effect, I am trying to use the SolrAdmin CREATE method. I have
> Solr 5.3.1 installed on my machine, and am trying to create a core where
> instanceDir is a path to the core (also on my machine). Even if I move
> instanceDir into the Solr root, I still see that the only fields returned
> in the schema are the default fields.
>
> If there is an preferable (non-cloud) way to create a core to point at an
> existing instanceDir please advise!
>
> Thank you,
> Natasha
>
>
>
> On Thu, Oct 29, 2015 at 8:58 PM, Erick Erickson [via Lucene] <
> ml-node+s472066n4237322h82@n3.nabble.com> wrote:
>
>> I'm pretty confused about what you're trying to do. You mention using
>> the SolrCloud UI to look at your core, but on the other hand you also
>> mention using the core admin to create the core.
>>
>> Trying to use the core admin commands with SolrCloud is a recipe for
>> disaster. Under the covers, the _collections_ api does, indeed, use
>> the core admin API to create cores, but it really must be precisely
>> done. If you're going to try to create your own cores, I recommend
>> setting up a non-SolrCloud system.
>>
>> If you want to use SolrCloud, then I _strongly_ recommend you use the
>> collections API to create your collections. You can certainly have a
>> single-shard collection that would be a leader-only collection (i.e.
>> no followers), which would have only a single core cluster-wide if
>> that fits your architecture....
>>
>> As it is, in cloud mode Solr expects the configs to be up on
>> Zookeeper, not resident on disk somewhere. And the admin core create
>> command promises that you have the configs in
>> /Users/nw/Downloads/twc-session-dash/collection1 which is a recipe for
>> confusion on Solr's part...
>>
>> HTH,
>> Erick
>>
>> On Thu, Oct 29, 2015 at 4:24 PM, natasha <[hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=4237322&i=0>> wrote:
>>
>> > Note, if I attempt to CREATE the core using Solr 5.3.0 on my openstack
>> > machine (Java version 1.7.0) I have no issues.
>> >
>> >
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> http://lucene.472066.n3.nabble.com/Solr-5-3-1-CREATE-defaults-to-schema-less-mode-Java-version-1-7-0-45-tp4237305p4237307.html
>> > Sent from the Solr - User mailing list archive at Nabble.com.
>>
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://lucene.472066.n3.nabble.com/Solr-5-3-1-CREATE-defaults-to-schema-less-mode-Java-version-1-7-0-45-tp4237305p4237322.html
>> To unsubscribe from Solr 5.3.1 CREATE defaults to schema-less mode Java
>> version 1.7.0_45, click here
>> <http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4237305&code=bmF0YXNoYUBmYWN0dWFsLmNvbXw0MjM3MzA1fDkzODY1MjkzNw==>
>> .
>> NAML
>> <http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>




--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-5-3-1-CREATE-defaults-to-schema-less-mode-Java-version-1-7-0-45-tp4237305p4237452.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr 5.3.1 CREATE defaults to schema-less mode Java version 1.7.0_45

Posted by Erick Erickson <er...@gmail.com>.
I'm pretty confused about what you're trying to do. You mention using
the SolrCloud UI to look at your core, but on the other hand you also
mention using the core admin to create the core.

Trying to use the core admin commands with SolrCloud is a recipe for
disaster. Under the covers, the _collections_ api does, indeed, use
the core admin API to create cores, but it really must be precisely
done. If you're going to try to create your own cores, I recommend
setting up a non-SolrCloud system.

If you want to use SolrCloud, then I _strongly_ recommend you use the
collections API to create your collections. You can certainly have a
single-shard collection that would be a leader-only collection (i.e.
no followers), which would have only a single core cluster-wide if
that fits your architecture....

As it is, in cloud mode Solr expects the configs to be up on
Zookeeper, not resident on disk somewhere. And the admin core create
command promises that you have the configs in
/Users/nw/Downloads/twc-session-dash/collection1 which is a recipe for
confusion on Solr's part...

HTH,
Erick

On Thu, Oct 29, 2015 at 4:24 PM, natasha <na...@factual.com> wrote:
> Note, if I attempt to CREATE the core using Solr 5.3.0 on my openstack
> machine (Java version 1.7.0) I have no issues.
>
>
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Solr-5-3-1-CREATE-defaults-to-schema-less-mode-Java-version-1-7-0-45-tp4237305p4237307.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr 5.3.1 CREATE defaults to schema-less mode Java version 1.7.0_45

Posted by natasha <na...@factual.com>.
Note, if I attempt to CREATE the core using Solr 5.3.0 on my openstack
machine (Java version 1.7.0) I have no issues.





--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-5-3-1-CREATE-defaults-to-schema-less-mode-Java-version-1-7-0-45-tp4237305p4237307.html
Sent from the Solr - User mailing list archive at Nabble.com.