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 Christian Bongiorno <ch...@gmail.com> on 2013/12/13 22:09:12 UTC

installing a 3rd party index

Has anyone tried to take an index generated elsewhere and install it in a
core? I have done that and I can see all the documents if I do "q=*:*" but
I can't actually query any of the fields even though I added the field
names to schema

I am kind of a rookie so forgive me if I come across as such. I have been
searching around for this scenario and haven't seen any discussion on it

-- 
Christian Bongiorno

Re: installing a 3rd party index

Posted by Christian Bongiorno <ch...@gmail.com>.
I will give this a try. Thanks.


On Fri, Dec 13, 2013 at 1:15 PM, Greg Walters <gr...@answers.com>wrote:

> Christian,
>
> I literally did this 10 minutes ago for an internal example. You need to
> issue a RELOAD for your index to open a new searcher using the updated
> files. Here's an example showing how I did it:
>
> ** Creating a new collection
> Greg-Walters-MacBook-Pro:SolrUpload greg.walters$ curl "
> http://localhost:8983/solr/admin/collections?action=CREATE&name=test1&numShards=6&collection.configName=collection1&maxShardsPerNode=6
> "
> <?xml version="1.0" encoding="UTF-8"?>
> <response>
> <lst name="responseHeader"><int name="status">0</int><int
> name="QTime">5528</int></lst><lst name="success"><lst><lst
> name="responseHeader"><int name="status">0</int><int
> name="QTime">4524</int></lst><str
> name="core">test1_shard5_replica1</str></lst><lst><lst
> name="responseHeader"><int name="status">0</int><int
> name="QTime">4536</int></lst><str
> name="core">test1_shard1_replica1</str></lst><lst><lst
> name="responseHeader"><int name="status">0</int><int
> name="QTime">4537</int></lst><str
> name="core">test1_shard3_replica1</str></lst><lst><lst
> name="responseHeader"><int name="status">0</int><int
> name="QTime">4561</int></lst><str
> name="core">test1_shard4_replica1</str></lst><lst><lst
> name="responseHeader"><int name="status">0</int><int
> name="QTime">4564</int></lst><str
> name="core">test1_shard2_replica1</str></lst><lst><lst
> name="responseHeader"><int name="status">0</int><int
> name="QTime">4566</int></lst><str
> name="core">test1_shard6_replica1</str></lst></lst>
> </response>
>
> ** Putting data into the new collection
> Greg-Walters-MacBook-Pro:example greg.walters$ rm -rf
> solr/test1_shard1_replica1/data/index/*; cp split/part-0/*
> solr/test1_shard1_replica1/data/index/
> Greg-Walters-MacBook-Pro:example greg.walters$ rm -rf
> solr/test1_shard2_replica1/data/index/*; cp split/part-1/*
> solr/test1_shard2_replica1/data/index/
> Greg-Walters-MacBook-Pro:example greg.walters$ rm -rf
> solr/test1_shard3_replica1/data/index/*; cp split/part-2/*
> solr/test1_shard3_replica1/data/index/
> Greg-Walters-MacBook-Pro:example greg.walters$ rm -rf
> solr/test1_shard4_replica1/data/index/*; cp split/part-3/*
> solr/test1_shard4_replica1/data/index/
> Greg-Walters-MacBook-Pro:example greg.walters$ rm -rf
> solr/test1_shard5_replica1/data/index/*; cp split/part-4/*
> solr/test1_shard5_replica1/data/index/
> Greg-Walters-MacBook-Pro:example greg.walters$ rm -rf
> solr/test1_shard6_replica1/data/index/*; cp split/part-5/*
> solr/test1_shard6_replica1/data/index/
>
> ** Opening a new searcher with the new data
> Greg-Walters-MacBook-Pro:example greg.walters$ curl "
> http://localhost:8983/solr/admin/collections?action=RELOAD&name=test1"
> <?xml version="1.0" encoding="UTF-8"?>
> <response>
> <lst name="responseHeader"><int name="status">0</int><int
> name="QTime">3154</int></lst><lst name="success"><lst
> name="10.10.19.156:8983_solr"><lst name="responseHeader"><int
> name="status">0</int><int name="QTime">1696</int></lst></lst><lst
> name="10.10.19.156:8983_solr"><lst name="responseHeader"><int
> name="status">0</int><int name="QTime">1981</int></lst></lst><lst
> name="10.10.19.156:8983_solr"><lst name="responseHeader"><int
> name="status">0</int><int name="QTime">1983</int></lst></lst><lst
> name="10.10.19.156:8983_solr"><lst name="responseHeader"><int
> name="status">0</int><int name="QTime">1980</int></lst></lst><lst
> name="10.10.19.156:8983_solr"><lst name="responseHeader"><int
> name="status">0</int><int name="QTime">1987</int></lst></lst><lst
> name="10.10.19.156:8983_solr"><lst name="responseHeader"><int
> name="status">0</int><int name="QTime">1989</int></lst></lst></lst>
> </response>
>
> Thanks,
> Greg
>
> On Dec 13, 2013, at 3:09 PM, Christian Bongiorno <
> christian.bongiorno@gmail.com> wrote:
>
> > Has anyone tried to take an index generated elsewhere and install it in a
> > core? I have done that and I can see all the documents if I do "q=*:*"
> but
> > I can't actually query any of the fields even though I added the field
> > names to schema
> >
> > I am kind of a rookie so forgive me if I come across as such. I have been
> > searching around for this scenario and haven't seen any discussion on it
> >
> > --
> > Christian Bongiorno
>
>


-- 
Christian Bongiorno

Re: installing a 3rd party index

Posted by Greg Walters <gr...@answers.com>.
Christian,

I literally did this 10 minutes ago for an internal example. You need to issue a RELOAD for your index to open a new searcher using the updated files. Here's an example showing how I did it:

** Creating a new collection
Greg-Walters-MacBook-Pro:SolrUpload greg.walters$ curl "http://localhost:8983/solr/admin/collections?action=CREATE&name=test1&numShards=6&collection.configName=collection1&maxShardsPerNode=6"
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">0</int><int name="QTime">5528</int></lst><lst name="success"><lst><lst name="responseHeader"><int name="status">0</int><int name="QTime">4524</int></lst><str name="core">test1_shard5_replica1</str></lst><lst><lst name="responseHeader"><int name="status">0</int><int name="QTime">4536</int></lst><str name="core">test1_shard1_replica1</str></lst><lst><lst name="responseHeader"><int name="status">0</int><int name="QTime">4537</int></lst><str name="core">test1_shard3_replica1</str></lst><lst><lst name="responseHeader"><int name="status">0</int><int name="QTime">4561</int></lst><str name="core">test1_shard4_replica1</str></lst><lst><lst name="responseHeader"><int name="status">0</int><int name="QTime">4564</int></lst><str name="core">test1_shard2_replica1</str></lst><lst><lst name="responseHeader"><int name="status">0</int><int name="QTime">4566</int></lst><str name="core">test1_shard6_replica1</str></lst></lst>
</response>

** Putting data into the new collection
Greg-Walters-MacBook-Pro:example greg.walters$ rm -rf solr/test1_shard1_replica1/data/index/*; cp split/part-0/* solr/test1_shard1_replica1/data/index/
Greg-Walters-MacBook-Pro:example greg.walters$ rm -rf solr/test1_shard2_replica1/data/index/*; cp split/part-1/* solr/test1_shard2_replica1/data/index/
Greg-Walters-MacBook-Pro:example greg.walters$ rm -rf solr/test1_shard3_replica1/data/index/*; cp split/part-2/* solr/test1_shard3_replica1/data/index/
Greg-Walters-MacBook-Pro:example greg.walters$ rm -rf solr/test1_shard4_replica1/data/index/*; cp split/part-3/* solr/test1_shard4_replica1/data/index/
Greg-Walters-MacBook-Pro:example greg.walters$ rm -rf solr/test1_shard5_replica1/data/index/*; cp split/part-4/* solr/test1_shard5_replica1/data/index/
Greg-Walters-MacBook-Pro:example greg.walters$ rm -rf solr/test1_shard6_replica1/data/index/*; cp split/part-5/* solr/test1_shard6_replica1/data/index/

** Opening a new searcher with the new data
Greg-Walters-MacBook-Pro:example greg.walters$ curl "http://localhost:8983/solr/admin/collections?action=RELOAD&name=test1"
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">0</int><int name="QTime">3154</int></lst><lst name="success"><lst name="10.10.19.156:8983_solr"><lst name="responseHeader"><int name="status">0</int><int name="QTime">1696</int></lst></lst><lst name="10.10.19.156:8983_solr"><lst name="responseHeader"><int name="status">0</int><int name="QTime">1981</int></lst></lst><lst name="10.10.19.156:8983_solr"><lst name="responseHeader"><int name="status">0</int><int name="QTime">1983</int></lst></lst><lst name="10.10.19.156:8983_solr"><lst name="responseHeader"><int name="status">0</int><int name="QTime">1980</int></lst></lst><lst name="10.10.19.156:8983_solr"><lst name="responseHeader"><int name="status">0</int><int name="QTime">1987</int></lst></lst><lst name="10.10.19.156:8983_solr"><lst name="responseHeader"><int name="status">0</int><int name="QTime">1989</int></lst></lst></lst>
</response>

Thanks,
Greg

On Dec 13, 2013, at 3:09 PM, Christian Bongiorno <ch...@gmail.com> wrote:

> Has anyone tried to take an index generated elsewhere and install it in a
> core? I have done that and I can see all the documents if I do "q=*:*" but
> I can't actually query any of the fields even though I added the field
> names to schema
> 
> I am kind of a rookie so forgive me if I come across as such. I have been
> searching around for this scenario and haven't seen any discussion on it
> 
> -- 
> Christian Bongiorno


Re: installing a 3rd party index

Posted by Christian Bongiorno <ch...@gmail.com>.
I have the code that originally made this index. I know all those details.
I have a schema with matching field names to what's in the code and I get
nothing.

What should I be looking for from the original code that just makes this
work?

And yes, it did scream "mismatched schema" to me; it was the very first
thing I tried.




On Fri, Dec 13, 2013 at 3:44 PM, Chris Hostetter
<ho...@fucit.org>wrote:

>
> : Has anyone tried to take an index generated elsewhere and install it in a
> : core? I have done that and I can see all the documents if I do "q=*:*"
> but
> : I can't actually query any of the fields even though I added the field
> : names to schema
>
> that combination (docs are clearly visible when doing a serach for *:* but
> no results when you try to query on specific fields) screams out an
> obvious explanation: the schema.xml you have created is not consistent
> with the schema.xml used to create the index.
>
> Trying to manually "guess" what the schema should be, and manually
> creating a schema.xml based on an index you "found" is border line
> impossible (if you were really familiar with Solr you could probably
> stumble your way through and figure out a decent chunk of stuff, but for a
> novice it would be a nightmare)
>
> just because you know that the index has a *stored* field named
> "doc_title" doesn't mean you know wether that field was *indexed*, or what
> kind of FieldTYpe/Analyzer was used when it was indexed.
>
> However: if you have the schema.xml from the Solr server that created the
> index, (or a copy of the code that created the index if it was made w/o
> SOlr using low level Lucene method calls) then you should have everything
> you need.
>
> -Hoss
> http://www.lucidworks.com/
>



-- 
Christian Bongiorno

Re: installing a 3rd party index

Posted by Chris Hostetter <ho...@fucit.org>.
: Has anyone tried to take an index generated elsewhere and install it in a
: core? I have done that and I can see all the documents if I do "q=*:*" but
: I can't actually query any of the fields even though I added the field
: names to schema

that combination (docs are clearly visible when doing a serach for *:* but 
no results when you try to query on specific fields) screams out an 
obvious explanation: the schema.xml you have created is not consistent 
with the schema.xml used to create the index.  

Trying to manually "guess" what the schema should be, and manually 
creating a schema.xml based on an index you "found" is border line 
impossible (if you were really familiar with Solr you could probably 
stumble your way through and figure out a decent chunk of stuff, but for a 
novice it would be a nightmare) 

just because you know that the index has a *stored* field named 
"doc_title" doesn't mean you know wether that field was *indexed*, or what 
kind of FieldTYpe/Analyzer was used when it was indexed.

However: if you have the schema.xml from the Solr server that created the 
index, (or a copy of the code that created the index if it was made w/o 
SOlr using low level Lucene method calls) then you should have everything 
you need.

-Hoss
http://www.lucidworks.com/