Hi!
I'm looking for a solution for the following problem:
I would like to get all the values for a specific dimension for
SortedSetDocValues per document. I've basically copied
SortedSetDocValuesFacetCounts, but instead of just counting, I build a
map from doc to values. The problem here is, that I have to iterate
through all ords and map them to global ords to check if they belong to
the desired dimension. And this is very inefficient. Is there a better
way, to iterate through documents and get all the values for a specific
dimension?
Here is a simplified code of what I'm doing now:
SortedSetDocValuesReaderState state;
LongValues segOrdMap = ordinalMap.getGlobalOrds(segOrd);
SortedSetDocValues it = DocValues.getSortedSet(reader, field);
OrdRange dimOrdRange = state.getOrdRange(dim);
for (int doc = it.nextDoc();...)
for (long term = it.nextOrd(); ...)
long globalTerm = segOrdMap.get(term) : term;
if (globalTerm >= dimOrdRange.start &&
globalTerm <= dimOrdRange end) {
// add doc/globalTerm
}
}
}
Am I on the completely wrong path here?
Thanks in advance and regards
harry
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
I'm looking for a solution for the following problem:
I would like to get all the values for a specific dimension for
SortedSetDocValues per document. I've basically copied
SortedSetDocValuesFacetCounts, but instead of just counting, I build a
map from doc to values. The problem here is, that I have to iterate
through all ords and map them to global ords to check if they belong to
the desired dimension. And this is very inefficient. Is there a better
way, to iterate through documents and get all the values for a specific
dimension?
Here is a simplified code of what I'm doing now:
SortedSetDocValuesReaderState state;
LongValues segOrdMap = ordinalMap.getGlobalOrds(segOrd);
SortedSetDocValues it = DocValues.getSortedSet(reader, field);
OrdRange dimOrdRange = state.getOrdRange(dim);
for (int doc = it.nextDoc();...)
for (long term = it.nextOrd(); ...)
long globalTerm = segOrdMap.get(term) : term;
if (globalTerm >= dimOrdRange.start &&
globalTerm <= dimOrdRange end) {
// add doc/globalTerm
}
}
}
Am I on the completely wrong path here?
Thanks in advance and regards
harry
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org