Care to define huge?  There often isn't a "best" solution but in this
case I think I'd vote for the index-per-year approach.

btw with recent versions of lucene you don't need to call optimize()
very often, if at all, although you might want to run it at the
beginning of each year against the previous year's index, now static.


--
Ian.


On Thu, Mar 24, 2011 at 2:00 PM, sol myr <solmy...@gmail.com> wrote:
> Hi,
>
> I need to search a Catalog.
> Most users search *this* year's catalog, but on rare occasions they may ask
> for old products (from previous years).
> I'm trying to select between 2 options:
>
> 1) Keep huge big index for all years (where documents have a "year" field,
> so I can filter out the current year, when needed)
>
> 2) Keep separate indexes - FSDirectory per year:
> FSDirectory.open("c:/index_2009/"),  FSDirectory.open("c:/index_2010/") ...
> Most searches will run on the current year's FSDirectory, but if I want old
> product I can use MultiSearcher.
>
> Which option sounds better?
> The 1st seems easier to code.
> But I thought the 2nd might have better performance - especially since most
> searches are on the current year.
> Moreover, since changes occur only on current year (old products never
> change), I though the 2nd approach would be easier on the IndexWriter
> (especially on heavy actions like "optimize()").
>
> What do you thing?
> Thanks :)
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to