Forum: Ferret Multiple indexes?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bcfc926d36e15709d7e6c70b9791211a?d=identicon&s=25 Vamsee Kanakala (Guest)
on 2006-01-02 13:19
(Received via mailing list)
Hi,

       I'm indexing records from different database tables and they have
identical column names in many cases. Does this mean I have to create
different indexes for each table?

TIA,
Vamsee.
4d6a47158a7c8a032e5f6a4da8976d7d?d=identicon&s=25 Erik Hatcher (Guest)
on 2006-01-02 17:15
(Received via mailing list)
Not necessarily.  If you index the table name as a separate field for
each document added to the index, it can be used (as a TermQuery
clause) to constrain searches for just documents from a specific
table.  The acts_as_ferret posted to the Ferret wiki does this, for
example.

	Erik
Bcfc926d36e15709d7e6c70b9791211a?d=identicon&s=25 Vamsee Kanakala (Guest)
on 2006-01-03 13:36
(Received via mailing list)
Erik Hatcher wrote:

>Not necessarily.  If you index the table name as a separate field for
>each document added to the index, it can be used (as a TermQuery
>clause) to constrain searches for just documents from a specific
>table.  The acts_as_ferret posted to the Ferret wiki does this, for
>example.
>
>
Thanks, Erik. That raises the obvious question I should've asked before
- which is a better approach and which is faster?


TIA,
Vamsee.
C9dd93aa135988cabf9183d3210665ca?d=identicon&s=25 Jens Kraemer (Guest)
on 2006-01-03 13:57
(Received via mailing list)
On Tue, Jan 03, 2006 at 06:05:31PM +0530, Vamsee Kanakala wrote:
> - which is a better approach and which is faster?
Imho this depends on how your queries look like.

If you want to run queries across all tables, having only one index
should be faster because no merging of results from different indexes
has to take place.

On the other hand, if you want to query only data of one of your tables,
having a dedicated index for that table should be faster.

But unless you have huge amounts of data in your indexes, in practice
the difference in speed won't matter. At least that's what I experienced
with Java lucene.

Jens


--
webit! Gesellschaft für neue Medien mbH          www.webit.de
Dipl.-Wirtschaftsingenieur Jens Krämer       kraemer@webit.de
Schnorrstraße 76                      Telefon +49 351 46766 0
D-01069 Dresden                      Telefax +49 351 46766 66
This topic is locked and can not be replied to.