@foo is following two friends, @bar and @baz @bar follows @foo and @quux @baz follows @quux and @wiix
I need to fetch all comments made by who @foo's following, @bar and @baz.
The problem is that I need also, later, fetch all comments made by who @foo's followers are following, @quux and @wiix. Is there a way to do it
with ElasticSearch?
It's do-able but that's the sort of problem where the volume of search
terms and results grows exponentially with each "hop" or degree of
separation you follow.
You can hit one single guy who follows thousands of others and they all end
up becoming new search terms as you explore the graph. If each of them
follow many people you reach a lot of content in only 2 hops.
Each unique search term will cost you time in random disk seeks so it gets
expensive fast. That is not a limitation of elastic-search - just graph
searches in general.
@foo is following two friends, @bar and @baz @bar follows @foo and @quux @baz follows @quux and @wiix
I need to fetch all comments made by who @foo's following, @bar and @baz.
The problem is that I need also, later, fetch all comments made by who @foo's followers are following, @quux and @wiix. Is there a way to do it
with Elasticsearch?
If the social graph can be traversed at indexing time, the leaves can be
indexed as documents, with anchor IDs and other attributes (e.g. the
user id, the node path, relationships of that node), and searching for
the leave attributes can be very fast. The process is known as
denormalization.
Traversing social graphs for collecting all(!) comments at search time
is usually a bad idea. There are often more contraints so the result set
can be built more efficiently. But graph traversal is not how
Elasticsearch works.
Jörg
Am 04.03.13 17:12, schrieb Mark Harwood:
Each unique search term will cost you time in random disk seeks so it
gets expensive fast. That is not a limitation of elastic-search - just
graph searches in general.
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.