Re: get distinct values from indexreader for given field

2023-12-05 Thread vvsevel
Thanks Michael On Tue, Nov 28, 2023 at 11:45 PM Michael Froh wrote: > Oh -- of course if you're using IntPoint / LongPoint for your numeric > fields, they won't be indexed as terms, so loading terms for them won't > work. > > It's not the prettiest solution, but I think the following should let

Re: get distinct values from indexreader for given field

2023-11-28 Thread Michael Froh
Oh -- of course if you're using IntPoint / LongPoint for your numeric fields, they won't be indexed as terms, so loading terms for them won't work. It's not the prettiest solution, but I think the following should let you collect the set of distinct point values for an IntPoint field:

Re: get distinct values from indexreader for given field

2023-11-28 Thread Michael Froh
Hello! Instead of MultiFields.getFields(), you can use MultiTerms.getTerms(reader, fieldname) to get the Terms instance. To decode your long / int values, you should be able to use LongPoint/IntPoint.unpack to write the values into an array: long[] val = new long[1]; // Assuming 1-D values LongP