Would there be any way to analyze base64 string fields so that one can
execute range queries on them. I want to store IPs (v4 and v6) as base64
encoded strings and be able to retrieve those within a given range.
Your client converts IP addresses to base64 strings before it indexes the
documents, so it must also use the same conversion to a base64 string when
querying the document.
Ranges are a little more complicated. For example. if you simply encode "9"
and "111" as strings, then you cannot perform range queries, since "111" is
less than "0", string-wise. In this case you must do something that ensures
that "9" is less than "111", typically by creating fixed-length input
strings before encoding; for example "009" and "111". Now the string
comparisons will match the intended numeric comparisons.
IP addresses will be more complex. But still, you will need to apply the
same external conversions in front of your queries that you do in front of
your indexing.
On Tuesday, January 14, 2014 4:00:58 PM UTC-5, InquiringMind wrote:
Your client converts IP addresses to base64 strings before it indexes the
documents, so it must also use the same conversion to a base64 string when
querying the document.
Ranges are a little more complicated. For example. if you simply encode
"9" and "111" as strings, then you cannot perform range queries, since "111"
is less than "9", string-wise. In this case you must do something that
ensures that "9" is less than "111", typically by creating fixed-length
input strings before encoding; for example "009" and "111". Now the string
comparisons will match the intended numeric comparisons.
IP addresses will be more complex. But still, you will need to apply the
same external conversions in front of your queries that you do in front of
your indexing.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.