Re: Immutable OpenBitSet?

2011-04-27 Thread Dawid Weiss
There are solutions to solve the initialization problem. The JVM guarantees > that an object is consistent after the ctor is run, so you can do the > initialization like this (please note the double {{}}, which is an inline > ctor, this is also often seen for unmodifiable HashSets): > > final OpenB

RE: Immutable OpenBitSet?

2011-04-27 Thread Uwe Schindler
There are solutions to solve the initialization problem. The JVM guarantees that an object is consistent after the ctor is run, so you can do the initialization like this (please note the double {{}}, which is an inline ctor, this is also often seen for unmodifiable HashSets): final OpenBitSet myb

RE: Immutable OpenBitSet?

2011-04-27 Thread Nader, John P
Thanks. Your project looks interesting. We've got some duplicate home-grown stuff here that is similar. As far as thread-safety, if one thread initializes an OpenBitSet's by setting one or bits and then hands that off to another thread, the other thread may see partial results. The long[] is

Re: Immutable OpenBitSet?

2011-04-27 Thread Federico Fissore
Nader, John P, il 27/04/2011 20:28, ha scritto: Hello, We have an application that relies heavily on caching OpenBitSets for reuse across multiple threads, and therefore multiple threads. [...] You don't need synchronization if you just read from an openbitset. And if you need to modify it,

Re: Immutable OpenBitSet?

2011-04-27 Thread Michael McCandless
This would be very useful to have, but I don't think Lucene has it now. Maybe Solr does? If not, please submit a patch :) Or, maybe try http://sna-projects.com/kamikaze? I think the focus there is compressed docID sets (in RAM), so I'm not sure you'll find something there... but, maybe? Mike

Immutable OpenBitSet?

2011-04-27 Thread Nader, John P
Hello, We have an application that relies heavily on caching OpenBitSets for reuse across multiple threads, and therefore multiple threads. I am looking into ways for making this both efficient and thread safe. In Java, the Immutable pattern is the most efficient way to make a cached object t

RE: lucene 3.0.3 | QueryParser | MultiFieldQueryParser

2011-04-27 Thread Steven A Rowe
Ranjit, The problem is definitely the analyzer you are passing to QueryParser or MultiFieldQueryParser, and not the parser itself. The following tests succeed using KeywordAnalyzer, which is a pass-through analyzer (the output is the same as the input): public void testSharpQP() throws Excep

Re: lucene 3.0.3 | QueryParser | MultiFieldQueryParser

2011-04-27 Thread Ranjit Kumar
Hi, while creating index with the help of lucene standardAnalyzer, we cannot make difference between c, c++ and c# as lucene do not create index for c++ and c#. To make the difference between these term I need to change the grammar of lucene with the help of jFlex, it force me to create my own