I have a search problem where my documents only contain integers (typically
a few thousand per doc)..and I need to do an exact search for an input set
of integers.
I was thinking of just adding them as normal files (strings- space
delimted), and then searching them.
Is there a more efficient way of searching, given the peculiar nature of the
problem? Maybe, using one or the more complex types that elastic search
supports ?
I have a search problem where my documents only contain integers (typically
a few thousand per doc)..and I need to do an exact search for an input set
of integers.
I was thinking of just adding them as normal files (strings- space
delimted), and then searching them.
Is there a more efficient way of searching, given the peculiar nature of the
problem? Maybe, using one or the more complex types that Elasticsearch
supports ?
I think indexing you documents with a single field carrying an array of
integers (at the json level) should be appropriate. At query time you would
then use a 'terms query' ( http://www.elasticsearch.org/guide/reference/query-dsl/terms-query.html) to
match one (or more) integers against the field.
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.