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 Faire Mii <fa...@gmail.com> on 2009/12/15 09:05:59 UTC

I cant get it to work

I just cant get it.

If i got 10 tables in mysql and they are all related to eachother with  
foreign keys. Should i have 10 documents in solr?

or just one document with rows from all tables in it?

i have tried in vain for 2 days now...plz help

regards

fayer

Re: I cant get it to work

Posted by regany <re...@newzealand.co.nz>.

I've only just started with Solr too.

As a newbie, first I'd say forget about trying to "compare" it to your mysql
database.

It's completely different and performs it's own job in it's own way. You
feed a document in, and you store that information in the most efficient
manner you can to perform the search and return the results you want.

So ask, what do I want to search against?

field1
field2
field3

That's what you "feed" into Solr.

Then ask, what information do I want to "return" after a search? This
determines how you "store" the information you've just "fed" into Solr. Say
you want to return:

field2

Then you might accept field1, field2, and field3 and merge them together
into 1 searchable field called "searchtext". This is what users will search
against. Then you'd also have "field2" as another field.

field2 (not indexed, stored)
searchtext (combination of field1,field2,field2 - indexed, not stored)

So then you could search against "searchtext" and return "field2" as the
result.

Hope that provides some explanation (I know it's basic). From my very
limited experience with, Solr is great. My biggest hurdle was getting my
head around the fact that it's NOT a relational database (ie. mysql) but a
separate tool that you configure  in the best way for your "search" and only
that.
-- 
View this message in context: http://old.nabble.com/I-cant-get-it-to-work-tp26791099p26792373.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: I cant get it to work

Posted by David Stuart <da...@progressivealliance.co.uk>.
Hi,

The answer is "it depends" ;)

If your 10 tables represent an entity e.g a person their address etc  
the one document entity works

But if your 10 tables each represnt a series of entites that you want  
to surface in your search results separately then make a document for  
each (I.e it depends on your data).

What is your use case? Are you wanting a search index that is able to  
search on every field in your 10 tables or just a few?
Think of it this way if you where creating SQL to pull the data out of  
the db using joins etc what fields would you grab, do you get multiple  
rows back because some of you tables have a one to many relationship.  
Once you have formed that query that is your document minus the  
duplicate information caused by the rows

Cheers

David

On 15 Dec 2009, at 08:05, Faire Mii <fa...@gmail.com> wrote:

> I just cant get it.
>
> If i got 10 tables in mysql and they are all related to eachother  
> with foreign keys. Should i have 10 documents in solr?
>
> or just one document with rows from all tables in it?
>
> i have tried in vain for 2 days now...plz help
>
> regards
>
> fayer