Hi,
I need to scan a secondary index and see the list of
primary Ids.
I started with geotable example by adding index=full for
"What" attibute.
// list the attributes that constitute the feature type
List<String> attributes = Lists.newArrayList(
"Who:String:index=full",
"What:java.lang.Long:index=full", // some
types require full qualification (see DataUtilities docs)
"When:Date", // a date-time field
is optional, but can be indexed
"*Where:Point:srid=4326", // the "*" denotes
the default geometry (used for indexing)
"Why:String" // you may have as
many other attributes as you like...
);
What I need is by scanning 'What' index to receive the
sorted List of pairs (What, Primary Feature Id)
For my understanding the fastest way to do it is just
scanning directly the index table and finding the feature Id
instead of scanning the index and seeking whole the feature at
the records table. But may be the whole feature is encoded at
the index table, so it does not require seeking in records
table.
For two features I see the next rows:
root@singlenode> scan -t geotable_attr_idx
\x01\x00\x00Addams\x0080000148368cObservation.0
: []
\x02\x00\x00\x00=Observation.\xB0Addam\xF3\x01\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x01H6\x8C\xF3\x00\x01\x01\xC0S\x03\xB1\xD6N4\xB6\xC0B\xCE\xD8n\x884\xE0\x80\x12\x18!*<
\x01\x00\x00Bierce\x00800001456f2aObservation.1
: []
\x02\x00\x00\x00=Observation.\xB1Bierc\xE5\x01\x00\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00\x01Eo*\xE7\xB0\x01\x01\xC0S_\x053\xD3\x90%\xC0Co\xE8
Z\xB1>\x80\x12\x18!*<
\x01\x00\x018000000000000000\x0080000148368cObservation.0
: []
\x02\x00\x00\x00=Observation.\xB0Addam\xF3\x01\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x01H6\x8C\xF3\x00\x01\x01\xC0S\x03\xB1\xD6N4\xB6\xC0B\xCE\xD8n\x884\xE0\x80\x12\x18!*<
\x01\x00\x018000000000000001\x00800001456f2aObservation.1
: []
\x02\x00\x00\x00=Observation.\xB1Bierc\xE5\x01\x00\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00\x01Eo*\xE7\xB0\x01\x01\xC0S_\x053\xD3\x90%\xC0Co\xE8
Z\xB1>\x80\x12\x18!*<
My questions are:
1. Is it any efficient top level API that I can
use?
If not:
2. Am I looking at the right table?
3. How to scan the rows to ignore the Who index
and use only What index?
4. How to decode the received rows?
Thank you!
Serge