You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Dan Wiggin <da...@gmail.com> on 2007/04/13 10:39:52 UTC

Design question

I'm reading  this list  eventually but  it a very active list and
useful,thks to all.
But so often, when a developer search how to work with lucene finds normally
the same code for same problems.
I think it will be useful create something like Best practices  with Lucene
or something  similar.

My question for example is a design question. Every time, you talk about a
single index to use, in my case (a platform with user groups no related
among themselves), i thinked the best option is use an index for every
group, and when I need to search something over all i will use a
Multisearcher instance (this action won't be frequently).My question is
how can I do manage all indexation system.
I thinked to create an IndexUpdater class which have a queue to recive all
events over the platform, this queu it will be emptied every X minutes, and
after this, Searcher will be updated.
I won't your opinion how to manage all indexes, for example I can create a
class (for exmaple EntityIndex) for every index which contains their
respetives IndexSearcher,IndexReader,IndexWriter and have every EntityIndex
in a hashmap. When it recived an element added in platform, gets their group
id, and search in hashmap to get its EntityIndex and work over it.

What do you think about this? Perhaps isn't a very good design and I want to
know your advices.

Thk for any reply, and I hope my question will be useful to others.

Re: Design question

Posted by "Peter W." <pe...@marketingbrokers.com>.
Dan,

I agree Lucene users are repeatedly solving the same
problems of reading, writing and creating indexes,
building queries, scaling, parsing docs etc.

There's a 'HowTo' section on the Wiki made
for sharing tips and best practices:
http://wiki.apache.org/lucene-java/HowTo

but few new additions are posted...

Regarding 'indexation' Lucene is a text search
engine but not an application server with concepts
of state management or pooling. Tomcat as
a front end might best suit your needs here.

Using regular JSP or servlets you can authenticate
group users and direct their input to appropriate
indexes. This avoids pairing ids to individual
IndexSearcher, IndexReader, IndexWriter
instances yourself.

No stacks, queues or linked hashmaps, just:
authenticate > group id > create session.

Contents of the url string or cookie-based session object
determine which Lucene index user data is written to.

Another option to consider is Solr.

Regards,

Peter W.


On Apr 13, 2007, at 1:39 AM, Dan Wiggin wrote:

> But so often, when a developer search how to work with lucene finds  
> normally
> the same code for same problems.
> I think it will be useful create something like Best practices   
> with Lucene
> or something  similar.
>

> My question is how can I do manage all indexation system.
> I thinked to create an IndexUpdater class which have a queue to  
> recive all
> events over the platform, this queu it will be emptied every X  
> minutes, and
> after this, Searcher will be updated.
> I won't your opinion how to manage all indexes, for example I can  
> create a
> class (for exmaple EntityIndex) for every index which contains their
> respetives IndexSearcher,IndexReader,IndexWriter and have every  
> EntityIndex
> in a hashmap. When it recived an element added in platform, gets  
> their group
> id, and search in hashmap to get its EntityIndex and work over it.

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