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 phil cryer <ph...@cryer.us> on 2009/01/08 23:00:29 UTC

Beginner: importing own data

So I have Solr running, I've run through the tutorials online, can
import data from the example xml and see the results, so it works!
Now, I take some xml data I have, convert it over to the add / doc
type that the demo ones are, run it and find out which fields aren't
defined in schema.xml, I add them there until they're all there and I
can finally import my own xml into solr w/o error.  But, when I go to
query solr, it's not there.  Again, I'm using the same procedure that
I used on the example xml files, and they did the 'commit' at the end,
so I'm doing something wrong.

Is that all I need to do, define my fields in schema.xml and then
import via post.jar?  It seems to work, but no results are ever found
by solr.  I'm open to trying any debugging or whatever, I need to
figure this out before I can start learning solr.

Thanks

P

Re: Beginner: importing own data

Posted by phil cryer <ph...@cryer.us>.
Paul
I have looked at those, but want to learn how to do the easy things
first - as I posted below I can import example data and then search
against it.  Data that I've tried to import seems to import, but I
can't search/find it, I want to know how to do this first, so if you
have any idea, I would appreciate it.

Thanks

P

On Thu, Jan 8, 2009 at 8:18 PM, Noble Paul നോബിള്‍ नोब्ळ्
<no...@gmail.com> wrote:
> did you explore using SolrJ to index data?
> http://wiki.apache.org/solr/Solrj
>
> or DataImportHandler.
> http://wiki.apache.org/solr/DataImportHandler
>
> On Fri, Jan 9, 2009 at 3:49 AM, Otis Gospodnetic
> <ot...@yahoo.com> wrote:
>> Phil,
>>
>> The easiest thing to do at this stage in Solr learning experience is to restart Solr (servlet container) and redo the search.  Results shouls start showing up then because this will effectively reopen the index.
>>
>>
>> Otis
>> --
>> Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch
>>
>>
>>
>> ----- Original Message ----
>>> From: phil cryer <ph...@cryer.us>
>>> To: solr-user@lucene.apache.org
>>> Sent: Thursday, January 8, 2009 5:00:29 PM
>>> Subject: Beginner: importing own data
>>>
>>> So I have Solr running, I've run through the tutorials online, can
>>> import data from the example xml and see the results, so it works!
>>> Now, I take some xml data I have, convert it over to the add / doc
>>> type that the demo ones are, run it and find out which fields aren't
>>> defined in schema.xml, I add them there until they're all there and I
>>> can finally import my own xml into solr w/o error.  But, when I go to
>>> query solr, it's not there.  Again, I'm using the same procedure that
>>> I used on the example xml files, and they did the 'commit' at the end,
>>> so I'm doing something wrong.
>>>
>>> Is that all I need to do, define my fields in schema.xml and then
>>> import via post.jar?  It seems to work, but no results are ever found
>>> by solr.  I'm open to trying any debugging or whatever, I need to
>>> figure this out before I can start learning solr.
>>>
>>> Thanks
>>>
>>> P
>>
>>
>
>
>
> --
> --Noble Paul
>

Re: Beginner: importing own data

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>.
did you explore using SolrJ to index data?
http://wiki.apache.org/solr/Solrj

or DataImportHandler.
http://wiki.apache.org/solr/DataImportHandler

On Fri, Jan 9, 2009 at 3:49 AM, Otis Gospodnetic
<ot...@yahoo.com> wrote:
> Phil,
>
> The easiest thing to do at this stage in Solr learning experience is to restart Solr (servlet container) and redo the search.  Results shouls start showing up then because this will effectively reopen the index.
>
>
> Otis
> --
> Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch
>
>
>
> ----- Original Message ----
>> From: phil cryer <ph...@cryer.us>
>> To: solr-user@lucene.apache.org
>> Sent: Thursday, January 8, 2009 5:00:29 PM
>> Subject: Beginner: importing own data
>>
>> So I have Solr running, I've run through the tutorials online, can
>> import data from the example xml and see the results, so it works!
>> Now, I take some xml data I have, convert it over to the add / doc
>> type that the demo ones are, run it and find out which fields aren't
>> defined in schema.xml, I add them there until they're all there and I
>> can finally import my own xml into solr w/o error.  But, when I go to
>> query solr, it's not there.  Again, I'm using the same procedure that
>> I used on the example xml files, and they did the 'commit' at the end,
>> so I'm doing something wrong.
>>
>> Is that all I need to do, define my fields in schema.xml and then
>> import via post.jar?  It seems to work, but no results are ever found
>> by solr.  I'm open to trying any debugging or whatever, I need to
>> figure this out before I can start learning solr.
>>
>> Thanks
>>
>> P
>
>



-- 
--Noble Paul

Re: Beginner: importing own data

Posted by phil cryer <ph...@cryer.us>.
Ah!  That got me going, thanks so much!  I've also created a all_Text
field in my schema where I can dump a bunch of other fields so they're
search-able.  Again, I appreciate all the above replies.

P

On Fri, Jan 9, 2009 at 10:48 AM, Shalin Shekhar Mangar
<sh...@gmail.com> wrote:
> You were searching for "1899" which is the value of the "date" field in the
> document you added. You need to specify q=date:1899 to search on the date
> field.
>
> You can also use the "<defaultSearchField>" element in schema.xml to specify
> the field on which you'd like to search if no field name is specified in the
> query. Typically, one creates a catch-all field which copies data from all
> the fields you want to search on.
>
> http://wiki.apache.org/solr/SchemaXml#head-b80c539a0a01eef8034c3776e49e8fe1c064f496
>
> Also look at the DisMax queries:
>
> http://wiki.apache.org/solr/DisMaxRequestHandler
>
> On Fri, Jan 9, 2009 at 8:35 PM, phil cryer <ph...@cryer.us> wrote:
>>
>> Otis
>> Thanks for your reply, I wrote out a long email explaining the steps I
>> took, and the results, but it was returned by the Solr-user email
>> server stamped as spam.  I've put my note on pastebin, you can see it
>> here: http://pastebin.cryer.us/pastebin.php?show=m359e2e47
>>
>> I'd appreciate any feedback, I know I'm close to getting this working,
>> just can't see what I'm missing.
>>
>> Thank you
>>
>> P
>>
>> On Thu, Jan 8, 2009 at 4:19 PM, Otis Gospodnetic
>> <ot...@yahoo.com> wrote:
>> > Phil,
>> >
>> > The easiest thing to do at this stage in Solr learning experience is to
>> > restart Solr (servlet container) and redo the search.  Results shouls start
>> > showing up then because this will effectively reopen the index.
>> >
>> >
>> > Otis
>> > --
>> > Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch
>> >
>> >
>> >
>> > ----- Original Message ----
>> >> From: phil cryer <ph...@cryer.us>
>> >> To: solr-user@lucene.apache.org
>> >> Sent: Thursday, January 8, 2009 5:00:29 PM
>> >> Subject: Beginner: importing own data
>> >>
>> >> So I have Solr running, I've run through the tutorials online, can
>> >> import data from the example xml and see the results, so it works!
>> >> Now, I take some xml data I have, convert it over to the add / doc
>> >> type that the demo ones are, run it and find out which fields aren't
>> >> defined in schema.xml, I add them there until they're all there and I
>> >> can finally import my own xml into solr w/o error.  But, when I go to
>> >> query solr, it's not there.  Again, I'm using the same procedure that
>> >> I used on the example xml files, and they did the 'commit' at the end,
>> >> so I'm doing something wrong.
>> >>
>> >> Is that all I need to do, define my fields in schema.xml and then
>> >> import via post.jar?  It seems to work, but no results are ever found
>> >> by solr.  I'm open to trying any debugging or whatever, I need to
>> >> figure this out before I can start learning solr.
>> >>
>> >> Thanks
>> >>
>> >> P
>> >
>> >
>
>
>
> --
> Regards,
> Shalin Shekhar Mangar.
>

Re: Beginner: importing own data

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
You were searching for "1899" which is the value of the "date" field in the
document you added. You need to specify q=date:1899 to search on the date
field.

You can also use the "<defaultSearchField>" element in schema.xml to specify
the field on which you'd like to search if no field name is specified in the
query. Typically, one creates a catch-all field which copies data from all
the fields you want to search on.

http://wiki.apache.org/solr/SchemaXml#head-b80c539a0a01eef8034c3776e49e8fe1c064f496

Also look at the DisMax queries:

http://wiki.apache.org/solr/DisMaxRequestHandler

On Fri, Jan 9, 2009 at 8:35 PM, phil cryer <ph...@cryer.us> wrote:

> Otis
> Thanks for your reply, I wrote out a long email explaining the steps I
> took, and the results, but it was returned by the Solr-user email
> server stamped as spam.  I've put my note on pastebin, you can see it
> here: http://pastebin.cryer.us/pastebin.php?show=m359e2e47
>
> I'd appreciate any feedback, I know I'm close to getting this working,
> just can't see what I'm missing.
>
> Thank you
>
> P
>
> On Thu, Jan 8, 2009 at 4:19 PM, Otis Gospodnetic
> <ot...@yahoo.com> wrote:
> > Phil,
> >
> > The easiest thing to do at this stage in Solr learning experience is to
> restart Solr (servlet container) and redo the search.  Results shouls start
> showing up then because this will effectively reopen the index.
> >
> >
> > Otis
> > --
> > Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch
> >
> >
> >
> > ----- Original Message ----
> >> From: phil cryer <ph...@cryer.us>
> >> To: solr-user@lucene.apache.org
> >> Sent: Thursday, January 8, 2009 5:00:29 PM
> >> Subject: Beginner: importing own data
> >>
> >> So I have Solr running, I've run through the tutorials online, can
> >> import data from the example xml and see the results, so it works!
> >> Now, I take some xml data I have, convert it over to the add / doc
> >> type that the demo ones are, run it and find out which fields aren't
> >> defined in schema.xml, I add them there until they're all there and I
> >> can finally import my own xml into solr w/o error.  But, when I go to
> >> query solr, it's not there.  Again, I'm using the same procedure that
> >> I used on the example xml files, and they did the 'commit' at the end,
> >> so I'm doing something wrong.
> >>
> >> Is that all I need to do, define my fields in schema.xml and then
> >> import via post.jar?  It seems to work, but no results are ever found
> >> by solr.  I'm open to trying any debugging or whatever, I need to
> >> figure this out before I can start learning solr.
> >>
> >> Thanks
> >>
> >> P
> >
> >
>



-- 
Regards,
Shalin Shekhar Mangar.

Re: Beginner: importing own data

Posted by phil cryer <ph...@cryer.us>.
Otis
Thanks for your reply, I wrote out a long email explaining the steps I
took, and the results, but it was returned by the Solr-user email
server stamped as spam.  I've put my note on pastebin, you can see it
here: http://pastebin.cryer.us/pastebin.php?show=m359e2e47

I'd appreciate any feedback, I know I'm close to getting this working,
just can't see what I'm missing.

Thank you

P

On Thu, Jan 8, 2009 at 4:19 PM, Otis Gospodnetic
<ot...@yahoo.com> wrote:
> Phil,
>
> The easiest thing to do at this stage in Solr learning experience is to restart Solr (servlet container) and redo the search.  Results shouls start showing up then because this will effectively reopen the index.
>
>
> Otis
> --
> Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch
>
>
>
> ----- Original Message ----
>> From: phil cryer <ph...@cryer.us>
>> To: solr-user@lucene.apache.org
>> Sent: Thursday, January 8, 2009 5:00:29 PM
>> Subject: Beginner: importing own data
>>
>> So I have Solr running, I've run through the tutorials online, can
>> import data from the example xml and see the results, so it works!
>> Now, I take some xml data I have, convert it over to the add / doc
>> type that the demo ones are, run it and find out which fields aren't
>> defined in schema.xml, I add them there until they're all there and I
>> can finally import my own xml into solr w/o error.  But, when I go to
>> query solr, it's not there.  Again, I'm using the same procedure that
>> I used on the example xml files, and they did the 'commit' at the end,
>> so I'm doing something wrong.
>>
>> Is that all I need to do, define my fields in schema.xml and then
>> import via post.jar?  It seems to work, but no results are ever found
>> by solr.  I'm open to trying any debugging or whatever, I need to
>> figure this out before I can start learning solr.
>>
>> Thanks
>>
>> P
>
>

Re: Beginner: importing own data

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Phil,

The easiest thing to do at this stage in Solr learning experience is to restart Solr (servlet container) and redo the search.  Results shouls start showing up then because this will effectively reopen the index.


Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch



----- Original Message ----
> From: phil cryer <ph...@cryer.us>
> To: solr-user@lucene.apache.org
> Sent: Thursday, January 8, 2009 5:00:29 PM
> Subject: Beginner: importing own data
> 
> So I have Solr running, I've run through the tutorials online, can
> import data from the example xml and see the results, so it works!
> Now, I take some xml data I have, convert it over to the add / doc
> type that the demo ones are, run it and find out which fields aren't
> defined in schema.xml, I add them there until they're all there and I
> can finally import my own xml into solr w/o error.  But, when I go to
> query solr, it's not there.  Again, I'm using the same procedure that
> I used on the example xml files, and they did the 'commit' at the end,
> so I'm doing something wrong.
> 
> Is that all I need to do, define my fields in schema.xml and then
> import via post.jar?  It seems to work, but no results are ever found
> by solr.  I'm open to trying any debugging or whatever, I need to
> figure this out before I can start learning solr.
> 
> Thanks
> 
> P