On 07/30/2014 11:31 AM, Michael McCandless wrote:
If you indexed with precStep=Integer.MAX_VALUE then your index should
only have the "shift 0" terms, I think.




Damn :(
I was wondering if that was the case but I wasn't sure because of (eventual compression and) the trie structure.
This means a bug somewhere (most likely in my code)

BTW, I'm indexing with 4.7.0 (im stuck on 4.7 because 4.8 require java 7 and try with resources which aren't (reliably) available before android 4.4)

Can you boil the exception case (values 1 to 2500) down to a small test case?

I'll investigate my code and see what I can do (I'm building the index after a huge build process with lots of computation) to bake a read only index

Thanks for the quick answer.
Olivier


Mike McCandless

http://blog.mikemccandless.com


On Wed, Jul 30, 2014 at 2:21 AM, Olivier Binda <olivier.bi...@wanadoo.fr> wrote:
Hello.

How do you get the terms for a TermsEnum of an IntField coded with
precisionStc = Integer.Max that you  get with
MultiFields.getTerms(reader, intField).iterator(null) ?

I had mitigated success trying to get the terms out of this iterator with
NumericUtils.prefixCodedToInt

I tried

while (true) {
                 BytesRef ref = termsEnum?.next()
                 if (ref == null) break
                 int value = NumericUtils.prefixCodedToInt(ref)
}

But it doesn't work (reliably) because of the trie structure I guess

In an IntField with values 1,2,3,4,5 it worked
But in an Int Field with all values from 1 to 2500, I got exceptions :
lots of shifts aren't in the 0..31 range and it looks like there are
"Blocks" with :

first a term with shift 0 and value n
followed by lots of terms with shift that aren't in 0..31 but who share the
same prefix...

Best regards,
Olivier


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




---------------------------------------------------------------------
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